]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #850 Flyout property panel: sketch features can not be created by clicking...
authornds <nds@opencascade.com>
Tue, 1 Sep 2015 06:31:07 +0000 (09:31 +0300)
committernds <nds@opencascade.com>
Tue, 1 Sep 2015 09:09:37 +0000 (12:09 +0300)
Additionaly the next regression is corrected: sketch, contour, translation, select lines with a rectangle[move over some lines], click Tab, waiting result-the next control in PP is activated, but it has not happened.

src/NewGeom/NewGeom_SalomeViewer.cpp
src/XGUI/XGUI_OperationMgr.cpp

index 6803bfe8c910d1d64672832c4c29af4d5c6fe480..3f5a801b5c01e074a349e10b09b715518e5f3809 100644 (file)
@@ -174,10 +174,6 @@ void NewGeom_SalomeViewer::onMouseDoubleClick(SUIT_ViewWindow* theView, QMouseEv
 void NewGeom_SalomeViewer::onMouseMove(SUIT_ViewWindow* theView, QMouseEvent* theEvent)
 {
   myView->setCurrentView(theView);
-  OCCViewer_ViewWindow* aViewWnd = dynamic_cast<OCCViewer_ViewWindow*>(theView);
-  Handle(AIS_InteractiveContext) aContext = AISContext();
-  if (aContext->HasDetected()) // Set focus to provide key events in the view
-    aViewWnd->getViewPort()->setFocus(Qt::MouseFocusReason);
   emit mouseMove(myView, theEvent);
 }
 
@@ -197,16 +193,6 @@ bool NewGeom_SalomeViewer::canDragByMouse() const
 //**********************************************
 void NewGeom_SalomeViewer::onKeyPress(SUIT_ViewWindow* theView, QKeyEvent* theEvent)
 {
-  OCCViewer_ViewWindow* aViewWnd = dynamic_cast<OCCViewer_ViewWindow*>(theView);
-  Handle(AIS_InteractiveContext) aContext = AISContext();
-  Handle(V3d_View) aView = aViewWnd->getViewPort()->getView();
-
-  bool noModifiers = (theEvent->modifiers() == Qt::NoModifier);
-  if ((theEvent->key() == Qt::Key_N) && noModifiers) {
-    aContext->HilightNextDetected(aView);
-  } else if ((theEvent->key() == Qt::Key_P) && noModifiers) {
-    aContext->HilightPreviousDetected(aView);
-  }
   emit keyPress(myView, theEvent);
 }
 
index 8cb968b1c1314fdb58a30613fb9af27f43888926..efc2ce9d51237e4490d6a8803b3243843bed21ad 100644 (file)
@@ -9,6 +9,7 @@
 #include "ModuleBase_Operation.h"
 #include "ModuleBase_IWorkshop.h"
 #include "ModuleBase_IModule.h"
+#include <ModuleBase_IViewer.h>
 #include "ModuleBase_OperationDescription.h"
 #include "ModuleBase_OperationFeature.h"
 
@@ -412,6 +413,20 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
       emit keyEnterReleased();
       commitOperation();
     }
+    case Qt::Key_N:
+    case Qt::Key_P: {
+      bool noModifiers = (theEvent->modifiers() == Qt::NoModifier);
+      if (noModifiers) {
+        ModuleBase_IViewer* aViewer = myWorkshop->viewer();
+        Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
+        Handle(V3d_View) aView = aViewer->activeView();
+        if ((theEvent->key() == Qt::Key_N))
+          aContext->HilightNextDetected(aView);
+        else if ((theEvent->key() == Qt::Key_P))
+          aContext->HilightPreviousDetected(aView);
+      }
+    }
+
     break;
     default:
       isAccepted = false;