From: nds Date: Tue, 20 May 2014 09:25:20 +0000 (+0400) Subject: refs #30 - Sketch base GUI: create, draw lines X-Git-Tag: V_0.2~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fe3f40fa1d24df6eda7bb9e8cd763409d4c2d655;p=modules%2Fshaper.git refs #30 - Sketch base GUI: create, draw lines "Esc" key release leads to stop any operation. --- diff --git a/src/PartSet/PartSet_OperationSketchBase.cpp b/src/PartSet/PartSet_OperationSketchBase.cpp index 997a96b12..3a02de8b8 100644 --- a/src/PartSet/PartSet_OperationSketchBase.cpp +++ b/src/PartSet/PartSet_OperationSketchBase.cpp @@ -71,3 +71,15 @@ void PartSet_OperationSketchBase::mouseReleased(QMouseEvent* theEvent, Handle_V3 void PartSet_OperationSketchBase::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView) { } + +void PartSet_OperationSketchBase::keyReleased(const int theKey) +{ + switch (theKey) { + case Qt::Key_Escape: { + abort(); + } + break; + default: + break; + } +} diff --git a/src/PartSet/PartSet_OperationSketchBase.h b/src/PartSet/PartSet_OperationSketchBase.h index b11406c2d..33b9e1d04 100644 --- a/src/PartSet/PartSet_OperationSketchBase.h +++ b/src/PartSet/PartSet_OperationSketchBase.h @@ -85,7 +85,7 @@ public: /// Processes the key pressed in the view /// \param theKey a key value - virtual void keyReleased(const int theKey) {}; + virtual void keyReleased(const int theKey); signals: /// Signal about the feature construing is finished diff --git a/src/PartSet/PartSet_OperationSketchLine.cpp b/src/PartSet/PartSet_OperationSketchLine.cpp index e1c31afd1..dc67cae98 100644 --- a/src/PartSet/PartSet_OperationSketchLine.cpp +++ b/src/PartSet/PartSet_OperationSketchLine.cpp @@ -175,16 +175,13 @@ void PartSet_OperationSketchLine::mouseMoved(QMouseEvent* theEvent, Handle(V3d_V void PartSet_OperationSketchLine::keyReleased(const int theKey) { switch (theKey) { - case Qt::Key_Escape: { - abort(); - } - break; case Qt::Key_Return: { abort(); emit launchOperation(PartSet_OperationSketchLine::Type(), boost::shared_ptr()); } break; default: + PartSet_OperationSketchBase::keyReleased(theKey); break; } }