Skip to content

Commit

Permalink
Pressing escape cancels offset tool
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 28, 2017
1 parent 8a7fc25 commit 5c66526
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -42,6 +42,19 @@ QgsMapToolOffsetCurve::~QgsMapToolOffsetCurve()
delete mSnapVertexMarker;
}

void QgsMapToolOffsetCurve::keyPressEvent( QKeyEvent *e )
{
if ( e && e->key() == Qt::Key_Escape && !e->isAutoRepeat() )
{
deleteRubberBandAndGeometry();
deleteDistanceWidget();
}
else
{
QgsMapToolEdit::keyPressEvent( e );
}
}


void QgsMapToolOffsetCurve::canvasReleaseEvent( QgsMapMouseEvent *e )
{
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsmaptooloffsetcurve.h
Expand Up @@ -31,6 +31,7 @@ class APP_EXPORT QgsMapToolOffsetCurve: public QgsMapToolEdit
QgsMapToolOffsetCurve( QgsMapCanvas *canvas );
~QgsMapToolOffsetCurve();

void keyPressEvent( QKeyEvent *e ) override;
void canvasReleaseEvent( QgsMapMouseEvent *e ) override;
void canvasMoveEvent( QgsMapMouseEvent *e ) override;

Expand Down

0 comments on commit 5c66526

Please sign in to comment.