diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-12-02 16:43:05 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-12-04 15:00:25 +0100 |
commit | e2af7c3b37095e601a84cc52de69a99af8e5d3a2 (patch) | |
tree | 1fa7b65d886af75e6c8c5fba1893e642e7e8d0cc /src/quick/items/qquicktableview.cpp | |
parent | e394979d24c83f0b937c9c436173c6a573e5644a (diff) |
Fix ObjectModel item not being rendered when moved between models
When moving an item from ObjectModel A to ObjectModel B, polishes are
scheduled for the respective ListViews in order: the ListView for A
first, and then the ListView for B. However, when it comes time to
do the actual polishing via updatePolish(), the list of items is
traversed backwards. This means that the following calls
var item = objectModelA.get(0)
objectModelA.remove(0, 1)
objectModelB.insert(0, item)
will result in updatePolish() being called for ListView B first, and
then ListView A. As a result of this, setCulled(false) will be called
by ListView B (since the item is now visible within it), followed by
ListView A calling setCulled(true) (since the item is now no longer in
it).
As there is no way for these models to know about each other (and it's
not feasible to store refcounts in QQuickItemPrivate::extraData, since
ObjectModel is in QtQml.Models, which can't know about QtQuick), this
patch makes ListView check if the item is parented to its contentItem
before culling it. This prevents it from hiding items which are no
longer shown in its view.
Change-Id: If50614ebc269fae875195bbc63c0c04dab237775
Fixes: QTBUG-67986
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
0 files changed, 0 insertions, 0 deletions