qtdeclarative/tests/auto/quick/qquicklistview
Fabian Kosmale 37c25c6e74 QQuickItemView: Skip instantiating delegates if size is 0
If the area of a (List|Grid)View is 0, then instantiating delegates is
pointless, as they couldn't be shown anyway. However, our current logic
could not handle this case well, and would end up instantiating a
delegate for every delegate entry if their size also ended up being 0 -
you can after all fit infinitely many 0 sized items into a zero sized
container.
Detect this situation in QQuickItemViewPrivate::refill and the
applyInsertionChange implementations. Note that we only exit early if
there are no visible items and the view is zero-sized; if there are
visible items, we still want to ensure that they are removed after all.

We also need to adjust a few tests which had zero sized views to no
longer be zero sized; otherwise they wouldn't have created their
delegates in time.

[ChangeLog][QtQuick][ListView][Important Behavior Change] If a ListView
has size zero, it won't instantiate any delegates until its size becomes
non-zero.

Pick-to: 6.5
Fixes: QTBUG-110625
Fixes: QTBUG-89568
Fixes: QTBUG-51773
Change-Id: Ibe0e6fa5f01784016882522c120d2fee38df285b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-04-20 09:26:38 +02:00
..
data QQuickItemView: Skip instantiating delegates if size is 0 2023-04-20 09:26:38 +02:00
BLACKLIST findItem: don't return items with invalid QQmlContexts 2022-06-16 21:26:20 +08:00
CMakeLists.txt Retire the qt_parse_all_arguments 2023-01-20 16:40:42 +01:00
incrementalmodel.cpp Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
incrementalmodel.h Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
proxytestinnermodel.cpp Port from container::count() and length() to size() 2022-10-07 23:38:48 +02:00
proxytestinnermodel.h Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
randomsortmodel.cpp Port from container::count() and length() to size() 2022-10-07 23:38:48 +02:00
randomsortmodel.h Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
reusemodel.h Use SPDX license identifiers 2022-06-11 08:05:15 +02:00
tst_qquicklistview.cpp Quick item view tests: fix compile warning 2023-04-18 13:11:16 +02:00