Skip to content

Commit 90e0fad

Browse files
nyalldawsonmhugent
authored andcommitted
Select previously locked items after running Unlock All
1 parent 082d497 commit 90e0fad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/composer/qgscomposition.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -1169,17 +1169,25 @@ void QgsComposition::lockSelectedItems()
11691169
void QgsComposition::unlockAllItems()
11701170
{
11711171
//unlock all items in composer
1172+
11721173
QUndoCommand* parentCommand = new QUndoCommand( tr( "Items unlocked" ) );
1174+
1175+
//first, clear the selection
1176+
clearSelection();
1177+
11731178
QList<QGraphicsItem *> itemList = items();
11741179
QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
11751180
for ( ; itemIt != itemList.end(); ++itemIt )
11761181
{
11771182
QgsComposerItem* mypItem = dynamic_cast<QgsComposerItem *>( *itemIt );
1178-
if ( mypItem )
1183+
if ( mypItem && mypItem->positionLock() )
11791184
{
11801185
QgsComposerItemCommand* subcommand = new QgsComposerItemCommand( mypItem, "", parentCommand );
11811186
subcommand->savePreviousState();
11821187
mypItem->setPositionLock( false );
1188+
//select unlocked items, same behaviour as illustrator
1189+
mypItem->setSelected( true );
1190+
emit selectedItemChanged( mypItem );
11831191
subcommand->saveAfterState();
11841192
}
11851193
}

0 commit comments

Comments
 (0)