[layout] fix mouse grab on locked items

Fix #57331
This commit is contained in:
Alessandro Pasotti 2024-05-23 13:38:14 +02:00 committed by Nyall Dawson
parent 0f72b2cedd
commit 549326c63a

View File

@ -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