Skip to content
Permalink
Browse files

Apply suggestions from code review

Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
rduivenvoorde and nyalldawson committed Mar 31, 2021
1 parent 499c5da commit 46d1d23cf71dc658583f3a5bc480506afc6753be
Showing with 3 additions and 9 deletions.
  1. +3 −9 src/gui/layout/qgslayoutviewtoolselect.cpp
@@ -218,11 +218,13 @@ void QgsLayoutViewToolSelect::layoutReleaseEvent( QgsLayoutViewMouseEvent *event
else
itemList = layout()->items( rect, selectionMode );

bool paperItemFocused = false;
QgsLayoutItemPage *focusedPaperItem = nullptr;
for ( QGraphicsItem *item : std::as_const( itemList ) )
{
QgsLayoutItem *layoutItem = dynamic_cast<QgsLayoutItem *>( item );
QgsLayoutItemPage *paperItem = dynamic_cast<QgsLayoutItemPage *>( item );
if ( paperItem )
focusedPaperItem = paperItem;

if ( layoutItem && !paperItem )
{
@@ -243,14 +245,6 @@ void QgsLayoutViewToolSelect::layoutReleaseEvent( QgsLayoutViewMouseEvent *event
}
}
}
else
{
if ( paperItem )
{
emit itemFocused( paperItem );
paperItemFocused = true;
}
}
}


0 comments on commit 46d1d23

Please sign in to comment.