Skip to content

Commit

Permalink
check menu after contextMenuAboutToShow
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and nyalldawson committed Apr 1, 2023
1 parent d6b0713 commit 88a812c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -1208,12 +1208,10 @@ void QgsMapCanvas::showContextMenu( QgsMapMouseEvent *event )
if ( !mapTool()->populateContextMenuWithEvent( &menu, event ) )
mMapTool->populateContextMenu( &menu );

if ( menu.isEmpty() ) // menu can be empty after populateContextMenu()
return;

emit contextMenuAboutToShow( &menu, event );

menu.exec( event->globalPos() );
if ( !menu.isEmpty() ) // menu can be empty after populateContextMenu() and contextMenuAboutToShow()
menu.exec( event->globalPos() );
}

void QgsMapCanvas::notifyRendererErrors( const QgsMapRendererJob::Errors &errors )
Expand Down

0 comments on commit 88a812c

Please sign in to comment.