]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refs #30 - Sketch base GUI: create, draw lines
authornds <natalia.donis@opencascade.com>
Tue, 20 May 2014 09:25:20 +0000 (13:25 +0400)
committernds <natalia.donis@opencascade.com>
Tue, 20 May 2014 09:25:20 +0000 (13:25 +0400)
"Esc" key release leads to stop any operation.

src/PartSet/PartSet_OperationSketchBase.cpp
src/PartSet/PartSet_OperationSketchBase.h
src/PartSet/PartSet_OperationSketchLine.cpp

index 997a96b1217e16b3d1e5dd55e0b530e7b589eac8..3a02de8b88ccba22a22ab639a4e29e927f35916f 100644 (file)
@@ -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;
+  }
+}
index b11406c2db1041b50c4d01ad5da7c04760d40618..33b9e1d04ee38bc4236255ebf9128be49bb5696d 100644 (file)
@@ -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
index e1c31afd1e00aa44f340f09507c08a93e6ef4143..dc67cae98597bc69e3eb376851b9f01fa54b9dcd 100644 (file)
@@ -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<ModelAPI_Feature>());
     }
     break;
     default:
+      PartSet_OperationSketchBase::keyReleased(theKey); 
     break;
   }
 }