From 5b5c8aa4615fb8fb5fa27374479f0807fa73d64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sat, 2 Dec 2023 00:10:22 +0100 Subject: Ensure ItemObservesViewport works when item is moved to new ancestor When an item has ItemObservesViewport set, it will receive transformChanged callbacks when any of its ancestors changes their position, size, etc. This relies on every ancestor having the subtreeTransformChangedEnabled flag set, which was previously ensured when the item called setFlag(). But when the item then moved to a different ancestor hierarchy, we would only set subtreeTransformChangedEnabled on the new parent, but not any of its ancestors, which meant that the item would no longer pick up changes beyond the immediate parent. We would also not send a transformChanged in response to the reparenting itself, which is critical, as the item's clip or scene positions may have changed in response to the new parent. Both of these cases are now handled as part of the ItemChildAddedChange of the new parent. Change-Id: I5000fb46d7638ce9674d4879890cf4344e5ce538 Reviewed-by: Volker Hilsheimer Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick/items/qquickitem_p.h') diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 205169066a..63c8896680 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -685,6 +685,8 @@ public: void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &); + void enableSubtreeChangeNotificationsForParentHierachy(); + virtual void mirrorChange() {} void setHasCursorInChild(bool hasCursor); -- cgit v1.2.3