diff options
author | Wang Chuan <ouchuanm@outlook.com> | 2019-07-11 10:24:38 +0800 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-07-16 06:56:34 +0000 |
commit | f806d64249c6e961ab12270d3a045e9980e19cf4 (patch) | |
tree | c85a6f3e731441f2d01d2b5fadf53a936968c568 /src | |
parent | 141ffbe37e9263829a156fc1f4d7b93a2bf311be (diff) |
QQuickItemView: refill itself before populate transition
The view uses a visible items list, which is maintained by the refill()
method, to determine which items should be triggered to do the populate
transition. The refill() was only invoked when component completed
before doing the populate transition; but if the size of the view
depends on the size of window (for example, using anchors.fill), more
delegates could become visible after component completed. In such a
case, part of visible items were not be triggered to do the transition.
[ChangeLog][QtQuick][Item Views] Item views such as ListView now properly
populate delegates with a populate transition when the view is resized
after componentComplete.
Fixes: QTBUG-76487
Change-Id: Id90c3f73d9911c8a1d6d8b1ea0c51f6c27d0ed5b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index d0715cdb7f..21d644dad5 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -1845,6 +1845,9 @@ void QQuickItemViewPrivate::layout() forceLayout = false; if (transitioner && transitioner->canTransition(QQuickItemViewTransitioner::PopulateTransition, true)) { + // Give the view one more chance to refill itself, + // in case its size is changed such that more delegates become visible after component completed + refill(); for (FxViewItem *item : qAsConst(visibleItems)) { if (!item->transitionScheduledOrRunning()) item->transitionNextReposition(transitioner, QQuickItemViewTransitioner::PopulateTransition, true); |