diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-28 17:48:06 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-01 08:22:40 +0100 |
commit | b81e27e65217f8425acb58c3ac848c728790c872 (patch) | |
tree | cc415691fffbde731a80611b8e48351be0cc74b7 /src/quick/items/qquickstateoperations.cpp | |
parent | 126afed75f738d93935b3b82f1afddda058ec148 (diff) |
QQuickStateOperations: updateGeometry() when setting x/y/w/h
Failing to call updateGeometry() and setting the various dirty flags
leads to inconsistent state.
Pick-to: 6.2 6.3
Fixes: QTBUG-99436
Fixes: QTBUG-98857
Change-Id: I15240b1670947da29e2f05e7ea41c7586f0b987a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/items/qquickstateoperations.cpp')
-rw-r--r-- | src/quick/items/qquickstateoperations.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index 54517e1ed6..d8380af756 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -482,12 +482,12 @@ void QQuickParentChangePrivate::reverseRewindHelper(const std::unique_ptr<QQuick { if (!target || !snapshot) return; - auto targetPriv = QQuickItemPrivate::get(target); + // leave existing bindings alive; new bindings are applied in applyBindings - targetPriv->x.setValueBypassingBindings(snapshot->x); - targetPriv->y.setValueBypassingBindings(snapshot->y); - targetPriv->width.setValueBypassingBindings(snapshot->width); - targetPriv->height.setValueBypassingBindings(snapshot->height); + // setPosition and setSize update the geometry without invalidating bindings + target->setPosition(QPointF(snapshot->x, snapshot->y)); + target->setSize(QSizeF(snapshot->width, snapshot->height)); + target->setScale(snapshot->scale); target->setRotation(snapshot->rotation); target->setParentItem(snapshot->parent); |