From c134ee3e7f7c88f59ae11f14a920c4f00239c7ec Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 28 Jul 2014 19:30:39 +0400 Subject: [PATCH] Process Enter key in edit sketch operation --- src/PartSet/PartSet_OperationFeatureEdit.cpp | 9 +++++++++ src/PartSet/PartSet_OperationFeatureEdit.h | 5 +++++ 2 files changed, 14 insertions(+) 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) -- 2.39.2