Skip to content
Permalink
Browse files

Escape cancels move tool

  • Loading branch information
nyalldawson committed Jan 19, 2018
1 parent fb0529b commit 045a17f798410cc802503fad33047a03d2afac73
Showing with 13 additions and 0 deletions.
  1. +10 −0 src/app/qgsmaptoolmovefeature.cpp
  2. +3 −0 src/app/qgsmaptoolmovefeature.h
@@ -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;
}
}
@@ -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;

0 comments on commit 045a17f

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