diff options
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 2faf755..443e669 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -103,8 +103,7 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() verticalScrollMode(QAbstractItemView::ScrollPerItem), horizontalScrollMode(QAbstractItemView::ScrollPerItem), currentIndexSet(false), - wrapItemText(false), - delayedPendingLayout(false) + wrapItemText(false) { } @@ -2396,9 +2395,8 @@ void QAbstractItemView::timerEvent(QTimerEvent *event) d->delayedEditing.stop(); edit(currentIndex()); } else if (event->timerId() == d->delayedLayout.timerId()) { - d->delayedLayout.stop(); + d->interruptDelayedItemsLayout(); if (isVisible()) { - d->interruptDelayedItemsLayout(); doItemsLayout(); const QModelIndex current = currentIndex(); if (current.isValid() && d->state == QAbstractItemView::EditingState) @@ -3060,7 +3058,7 @@ void QAbstractItemView::setIndexWidget(const QModelIndex &index, QWidget *widget d->addEditor(index, widget, true); widget->show(); dataChanged(index, index); // update the geometry - if (!d->delayedPendingLayout) + if (!d->delayedPendingLayout()) widget->setGeometry(visualRect(index)); } } @@ -3100,7 +3098,7 @@ void QAbstractItemView::scrollToTop() void QAbstractItemView::scrollToBottom() { Q_D(QAbstractItemView); - if (d->delayedPendingLayout) { + if (d->delayedPendingLayout()) { d->executePostedLayout(); updateGeometries(); } @@ -3145,14 +3143,14 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde delegate->setEditorData(editorInfo.editor, topLeft); } } - if (isVisible() && !d->delayedPendingLayout) { + if (isVisible() && !d->delayedPendingLayout()) { // otherwise the items will be update later anyway update(topLeft); } return; } d->updateEditorData(topLeft, bottomRight); - if (!isVisible() || d->delayedPendingLayout) + if (!isVisible() || d->delayedPendingLayout()) return; // no need to update d->viewport->update(); } @@ -3876,22 +3874,6 @@ bool QAbstractItemViewPrivate::shouldAutoScroll(const QPoint &pos) const || (area.right() - pos.x() < autoScrollMargin); } -void QAbstractItemViewPrivate::doDelayedItemsLayout(int delay) -{ - if (!delayedPendingLayout) { - delayedPendingLayout = true; - delayedLayout.start(delay, q_func()); - } -} - -void QAbstractItemViewPrivate::interruptDelayedItemsLayout() const -{ - delayedLayout.stop(); - delayedPendingLayout = false; -} - - - QWidget *QAbstractItemViewPrivate::editor(const QModelIndex &index, const QStyleOptionViewItem &options) { |