Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 31c456c

Browse files
committedMar 16, 2023
check menu after contextMenuAboutToShow
1 parent 3b2421d commit 31c456c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,12 +1208,10 @@ void QgsMapCanvas::showContextMenu( QgsMapMouseEvent *event )
12081208
if ( !mapTool()->populateContextMenuWithEvent( &menu, event ) )
12091209
mMapTool->populateContextMenu( &menu );
12101210

1211-
if ( menu.isEmpty() ) // menu can be empty after populateContextMenu()
1212-
return;
1213-
12141211
emit contextMenuAboutToShow( &menu, event );
12151212

1216-
menu.exec( event->globalPos() );
1213+
if ( !menu.isEmpty() ) // menu can be empty after populateContextMenu() and contextMenuAboutToShow()
1214+
menu.exec( event->globalPos() );
12171215
}
12181216

12191217
void QgsMapCanvas::notifyRendererErrors( const QgsMapRendererJob::Errors &errors )

0 commit comments

Comments
 (0)
Please sign in to comment.