diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-05-16 10:10:30 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-10-09 18:58:18 +0200 |
commit | 2d9cf3ef0fc09254b1a63ab04b86d9beb52e71bc (patch) | |
tree | 2a4a09fc481336b193677b7e58fc995aeda41681 /src/quick/items/qquickitemview_p_p.h | |
parent | d522746afa394960bef225ba08080d8364b69a7e (diff) |
When a DelegateModel delegate changes, refill the view
It looked a bit odd that the DelegateModel delegate property was not a
notifying property. Adding the delegateChanged signal makes it easier
to update the view when this happens. The previous approach of removing
all delegates and adding all new ones resulted in the view losing its
currentIndex and often scrolling to a different place. It's also nice
to reduce the number of d-> indirections by adding the
QQuickItemViewPrivate::applyDelegateChange() function, so that we just
need one indirection to call it, and then it updates all the internal
stuff in one place.
Done-with: Frederik Gladhorn
Done-with: Joni Poikelin
Fixes: QTBUG-63477
Change-Id: I2d17fd11ff4a2fcb20968a7182dd2c403abb715a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/items/qquickitemview_p_p.h')
-rw-r--r-- | src/quick/items/qquickitemview_p_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index ef674f0fc7..860cf5fa20 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -191,6 +191,8 @@ public: qreal calculatedMinExtent() const; qreal calculatedMaxExtent() const; + void applyDelegateChange(); + void applyPendingChanges(); bool applyModelChanges(ChangeResult *insertionResult, ChangeResult *removalResult); bool applyRemovalChange(const QQmlChangeSet::Change &removal, ChangeResult *changeResult, int *removedCount); |