From: vsv Date: Mon, 28 Jul 2014 15:30:39 +0000 (+0400) Subject: Process Enter key in edit sketch operation X-Git-Tag: V_0.4.4~136^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c134ee3e7f7c88f59ae11f14a920c4f00239c7ec;p=modules%2Fshaper.git Process Enter key in edit sketch operation --- diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index f3e4b2dbe..1a6fb55aa 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -162,6 +162,15 @@ void PartSet_OperationFeatureEdit::mouseDoubleClick(QMouseEvent* theEvent, Handl } } + +void PartSet_OperationFeatureEdit::keyReleased(const int theKey) +{ + if (theKey == Qt::Key_Return) { + commit(); + } else + PartSet_OperationSketchBase::keyReleased(theKey); +} + void PartSet_OperationFeatureEdit::startOperation() { PartSet_OperationSketchBase::startOperation(); diff --git a/src/PartSet/PartSet_OperationFeatureEdit.h b/src/PartSet/PartSet_OperationFeatureEdit.h index f893a964e..ac607e47f 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.h +++ b/src/PartSet/PartSet_OperationFeatureEdit.h @@ -106,6 +106,11 @@ public: virtual void mouseDoubleClick(QMouseEvent* theEvent, Handle_V3d_View theView, const std::list& theSelected, const std::list& theHighlighted); + + /// Processes the key pressed in the view + /// \param theKey a key value + virtual void keyReleased(const int theKey); + protected: /// \brief Virtual method called when operation is started /// Virtual method called when operation started (see start() method for more description)