From 549326c63ae9ddf2c89d1218383d2dceee1155a9 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Thu, 23 May 2024 13:38:14 +0200 Subject: [PATCH] [layout] fix mouse grab on locked items Fix #57331 --- src/core/layout/qgslayout.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/layout/qgslayout.cpp b/src/core/layout/qgslayout.cpp index 998e5e3c076..73c7fa826d7 100644 --- a/src/core/layout/qgslayout.cpp +++ b/src/core/layout/qgslayout.cpp @@ -328,6 +328,12 @@ QgsLayoutItem *QgsLayout::layoutItemAt( QPointF position, const QgsLayoutItem *b // already found that item, then we've found our target if ( ( ! belowItem || foundBelowItem ) && ( !ignoreLocked || !layoutItem->isLocked() ) ) { + // If ignoreLocked and item is part of a locked group, return the next item below + if ( ignoreLocked && layoutItem->parentGroup() && layoutItem->parentGroup()->isLocked() ) + { + return layoutItemAt( position, layoutItem, ignoreLocked, searchTolerance ); + } + return layoutItem; } else