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 Mar 17, 2023
1 parent cb6d3b6 commit b36bfa9
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 b36bfa9

Please sign in to comment.