From f806d64249c6e961ab12270d3a045e9980e19cf4 Mon Sep 17 00:00:00 2001 From: Wang Chuan Date: Thu, 11 Jul 2019 10:24:38 +0800 Subject: 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 --- src/quick/items/qquickitemview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/quick/items/qquickitemview.cpp') 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); -- cgit v1.2.3