Skip to content
Permalink
Browse files

Pressing escape cancels offset tool

  • Loading branch information
nyalldawson committed Nov 28, 2017
1 parent 8a7fc25 commit 5c66526c7d73f541c68ad06d2ee51dea82cc865b
Showing with 14 additions and 0 deletions.
  1. +13 −0 src/app/qgsmaptooloffsetcurve.cpp
  2. +1 −0 src/app/qgsmaptooloffsetcurve.h
@@ -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 )
{
@@ -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;

0 comments on commit 5c66526

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