Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void Q3ListBox::resizeEvent ( QResizeEvent e  )  [protected, virtual]

Reimplemented from Q3ScrollView.

Definition at line 3800 of file q3listbox.cpp.

References columnMode, Q3ScrollView::contentsHeight, Q3ScrollView::contentsWidth, currentItem, doLayout(), ensureCurrentVisible(), QSize::height(), itemRect(), itemVisible(), QResizeEvent::oldSize(), QWidget::repaint(), Q3ScrollView::resizeContents(), Q3ScrollView::resizeEvent(), rowMode, QResizeEvent::size(), Q3ScrollView::viewport(), Q3ScrollView::viewportSize(), and QSize::width().

{
    d->layoutDirty = (d->layoutDirty ||
                       rowMode() == FitToHeight ||
                       columnMode() == FitToWidth);

    if (!d->layoutDirty && columnMode() == FixedNumber &&
         d->numColumns == 1) {
        int w = d->columnPosOne;
        QSize s(viewportSize(w, contentsHeight()));
        w = qMax(w, s.width());
        d->columnPos[1] = qMax(w, d->columnPosOne);
        resizeContents(d->columnPos[1], contentsHeight());
    }

    if (d->resizeTimer->isActive())
        d->resizeTimer->stop();
    if (d->rowMode == FixedNumber && d->columnMode == FixedNumber) {
        bool currentItemVisible = itemVisible(currentItem());
        doLayout();
        Q3ScrollView::resizeEvent(e);
        if (currentItemVisible)
            ensureCurrentVisible();
        if (d->current)
            viewport()->repaint(itemRect(d->current));
    } else if ((d->columnMode == FitToWidth || d->rowMode == FitToHeight) && !(isVisible())) {
        Q3ScrollView::resizeEvent(e);
    } else if (d->layoutDirty) {
        d->resizeTimer->start(100, true);
        resizeContents(contentsWidth() - (e->oldSize().width() - e->size().width()),
                        contentsHeight() - (e->oldSize().height() - e->size().height()));
        Q3ScrollView::resizeEvent(e);
    } else {
        Q3ScrollView::resizeEvent(e);
    }
}


Generated by  Doxygen 1.6.0   Back to index