Skip to content

Commit

Permalink
Escape cancels move tool
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 20, 2018
1 parent fb0529b commit 045a17f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/qgsmaptoolmovefeature.cpp
Expand Up @@ -197,3 +197,13 @@ void QgsMapToolMoveFeature::deactivate()

QgsMapTool::deactivate();
}

void QgsMapToolMoveFeature::keyReleaseEvent( QKeyEvent *e )
{
if ( mRubberBand && e->key() == Qt::Key_Escape )
{
cadDockWidget()->clear();
delete mRubberBand;
mRubberBand = nullptr;
}
}
3 changes: 3 additions & 0 deletions src/app/qgsmaptoolmovefeature.h
Expand Up @@ -40,6 +40,9 @@ class APP_EXPORT QgsMapToolMoveFeature: public QgsMapToolAdvancedDigitizing

void deactivate() override;

//! catch escape when active to action
void keyReleaseEvent( QKeyEvent *e ) override;

private:
//! Start point of the move in map coordinates
QgsPointXY mStartPointMapCoords;
Expand Down

0 comments on commit 045a17f

Please sign in to comment.