Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 Jan 16, 2020
1 parent 4667152 commit ae25d61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -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 );
}

Expand Down

0 comments on commit ae25d61

Please sign in to comment.