Add patch for letting users of a QML ListView specify the delegate creation range
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qtdeclarative-opensource-src (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
By defaeult a QML ItemViews create items from contentY to contentY+height (with some buffering before and after). This is problematic when you embed an ItemView inside an ItemView (like we do in the dash) because you may end up with lots more of delegates instantiated than needed.
This patch adds two properties to the QML ItemViews letting a user decided if he wants to provide a range for delegate creation.
It comes with unit tests that show how only the needed items are being created instead of the full item view height.
After discussing this with the Qt Project QtQuick maintainer at the Qt Contributor Summit he rejected the idea to add this new feature in upstream Qt he decided to reject the idea as it was adding more feature cruft to classes that he wants rewritten. The rewrrite of those classes would also add this functionality so we are "safe" in this regard.
The patch need reviewing. I will be adding some Qt knowledgeable people to have a look.
More info at https:/
Related branches
- Daniel Holbach (community): Approve
- Michael Zanetti (community): Approve (code review)
-
Diff: 1168 lines (+977/-7)12 files modified.pc/applied-patches (+1/-0)
debian/changelog (+7/-0)
debian/patches/qtquick_delegate_creation_range_itemviews.patch (+565/-0)
debian/patches/series (+1/-0)
src/quick/items/qquickgridview.cpp (+1/-1)
src/quick/items/qquickitemview.cpp (+75/-5)
src/quick/items/qquickitemview_p.h (+12/-0)
src/quick/items/qquickitemview_p_p.h (+5/-1)
tests/auto/quick/qquickgridview/data/delegateCreationRange.qml (+89/-0)
tests/auto/quick/qquickgridview/tst_qquickgridview.cpp (+67/-0)
tests/auto/quick/qquicklistview/data/delegateCreationRange.qml (+84/-0)
tests/auto/quick/qquicklistview/tst_qquicklistview.cpp (+70/-0)
Michael/ Gerry/Michał, could you please review the patch?