From 1dbe3863a734d14c24414a0a8d8bf4f85b33dc19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Venerandi?= Date: Thu, 31 Oct 2024 10:07:49 +0000 Subject: [PATCH] Update ExpoCell contentItem position upon its parent change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the position of the contentItem depends on the position and scale of the parent item, make sure to re-evaluate it when the parent changes. BUG:495501 (cherry picked from commit d7acc24093ce70cd970b7d3bb830d766da051e20) Co-authored-by: Niccolò Venerandi --- src/plugins/private/expolayout.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/private/expolayout.cpp b/src/plugins/private/expolayout.cpp index 0d008c8bab..52e8bd6616 100644 --- a/src/plugins/private/expolayout.cpp +++ b/src/plugins/private/expolayout.cpp @@ -100,8 +100,14 @@ void ExpoCell::setContentItem(QQuickItem *item) return; } + if (m_contentItem) { + disconnect(m_contentItem, &QQuickItem::parentChanged, this, &ExpoCell::updateContentItemGeometry); + } + m_contentItem = item; + connect(m_contentItem, &QQuickItem::parentChanged, this, &ExpoCell::updateContentItemGeometry); + if (m_contentItem) { m_contentItem->setVisible(isVisible()); }