Skip to content
Permalink
Browse files

Clear QgsMapCanvas::mMapTool before emitting mapToolSet in QgsMapCanv…

…as::unsetMapTool

Otherwise, third-parties setting another tool based on the emitted signal will have their tool cleared again immediately
  • Loading branch information
manisandro authored and nyalldawson committed May 2, 2019
1 parent 4667152 commit ae25d6179ffa348bd959c13ce94b72dc7dd336be
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/gui/qgsmapcanvas.cpp
@@ -1786,8 +1786,9 @@ void QgsMapCanvas::unsetMapTool( QgsMapTool *tool )
{
disconnect( mMapTool, &QObject::destroyed, this, &QgsMapCanvas::mapToolDestroyed );
mMapTool->deactivate();
QgsMapTool *oldTool = mMapTool;
mMapTool = nullptr;
emit mapToolSet( nullptr, mMapTool );
emit mapToolSet( nullptr, oldTool );
setCursor( Qt::ArrowCursor );
}

0 comments on commit ae25d61

Please sign in to comment.
You can’t perform that action at this time.