From 59a4a908f995fd5cd50bae60e64c5ef4ce3d9fe2 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Fri, 15 Oct 2021 10:29:35 +0300 Subject: [PATCH] Properly update parent item's bounding rect when moving item The bounding rect of an item is in the item-local coordinate space. If the item is moved, its bounding rect won't change, but the parent's bounding rect, may change. BUG: 443756 --- src/item.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index 8905c521f1..925a90876c 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -106,7 +106,9 @@ void Item::setPosition(const QPoint &point) if (m_position != point) { scheduleRepaint(boundingRect()); m_position = point; - updateBoundingRect(); + if (m_parentItem) { + m_parentItem->updateBoundingRect(); + } scheduleRepaint(boundingRect()); Q_EMIT positionChanged(); }