diff options
Diffstat (limited to 'src/widgets/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/widgets/itemviews/qabstractitemview.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 70c8f44a73..f4a98d2575 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -63,7 +63,6 @@ #include <private/qabstractitemmodel_p.h> #ifndef QT_NO_ACCESSIBILITY #include <qaccessible.h> -#include <private/qaccessible2_p.h> #endif #ifndef QT_NO_GESTURES # include <qscroller.h> @@ -1108,6 +1107,7 @@ void QAbstractItemView::reset() QAccessible::updateAccessibility(&accessibleEvent); } #endif + d->updateGeometry(); } /*! @@ -1124,6 +1124,7 @@ void QAbstractItemView::setRootIndex(const QModelIndex &index) } d->root = index; d->doDelayedItemsLayout(); + d->updateGeometry(); } /*! @@ -2668,8 +2669,10 @@ void QAbstractItemView::updateEditorGeometries() */ void QAbstractItemView::updateGeometries() { + Q_D(QAbstractItemView); updateEditorGeometries(); - d_func()->fetchMoreTimer.start(0, this); //fetch more later + d->fetchMoreTimer.start(0, this); //fetch more later + d->updateGeometry(); } /*! @@ -3231,6 +3234,7 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde QAccessible::updateAccessibility(&accessibleEvent); } #endif + d->updateGeometry(); } /*! @@ -3332,6 +3336,7 @@ void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &index, int star QAccessible::updateAccessibility(&accessibleEvent); } #endif + updateGeometry(); } /*! @@ -3412,6 +3417,7 @@ void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &index, int s QAccessible::updateAccessibility(&accessibleEvent); } #endif + updateGeometry(); } @@ -3435,6 +3441,7 @@ void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int sta QAccessible::updateAccessibility(&accessibleEvent); } #endif + updateGeometry(); } /*! @@ -3459,6 +3466,7 @@ void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &index, int QAccessible::updateAccessibility(&accessibleEvent); } #endif + updateGeometry(); } /*! @@ -4084,7 +4092,14 @@ void QAbstractItemViewPrivate::interruptDelayedItemsLayout() const delayedPendingLayout = false; } - +void QAbstractItemViewPrivate::updateGeometry() +{ + Q_Q(QAbstractItemView); + if (sizeAdjustPolicy == QAbstractScrollArea::AdjustIgnored) + return; + if (sizeAdjustPolicy == QAbstractScrollArea::AdjustToContents || !shownOnce) + q->updateGeometry(); +} QWidget *QAbstractItemViewPrivate::editor(const QModelIndex &index, const QStyleOptionViewItem &options) |