From 0272c841c46f8017611f98ddff815225628d1af3 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 16 Sep 2024 14:04:57 +0000 Subject: [PATCH] scene: Invalidate parent's sorted child item list in Item::stack{Before,After} We update the parent's child list, so its sorted child list must be invalidated. (cherry picked from commit 32d7d8a1eae267016e69d152ae576268b86b7924) Co-authored-by: Vlad Zahorodnii --- src/scene/item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scene/item.cpp b/src/scene/item.cpp index 30a5585644..3ecaaf501a 100644 --- a/src/scene/item.cpp +++ b/src/scene/item.cpp @@ -314,7 +314,7 @@ void Item::stackBefore(Item *sibling) } m_parentItem->m_childItems.move(selfIndex, selfIndex > siblingIndex ? siblingIndex : siblingIndex - 1); - markSortedChildItemsDirty(); + m_parentItem->markSortedChildItemsDirty(); scheduleRepaint(boundingRect()); sibling->scheduleRepaint(sibling->boundingRect()); @@ -342,7 +342,7 @@ void Item::stackAfter(Item *sibling) } m_parentItem->m_childItems.move(selfIndex, selfIndex > siblingIndex ? siblingIndex + 1 : siblingIndex); - markSortedChildItemsDirty(); + m_parentItem->markSortedChildItemsDirty(); scheduleRepaint(boundingRect()); sibling->scheduleRepaint(sibling->boundingRect());