Salome HOME
Issue #2673: Provide N and P keys for traversing of highlighted entities
authorvsv <vsv@opencascade.com>
Wed, 3 Oct 2018 13:07:10 +0000 (16:07 +0300)
committervsv <vsv@opencascade.com>
Wed, 3 Oct 2018 13:07:29 +0000 (16:07 +0300)
src/ModuleBase/ModuleBase_IViewer.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_ViewerProxy.h

index c58173af9169b6146c9a1a7b93685e136113fc7e..adfa441ecad0352528701b9f628978dee7422d2e 100644 (file)
@@ -129,6 +129,9 @@ Q_OBJECT
   /// Fit all along Z (perpendicular to display)
   //virtual void Zfitall() = 0;
 
+  /// Show highlight for pre-highlighted sub-shape
+  virtual void updateHighlight() {}
+
   static Handle(Prs3d_Drawer) DefaultHighlightDrawer;
 
 signals:
index 1110d1b8d9bfefdf774a7a27d713328e3be88db5..a5f5b1bd6b26a758b39986debe0336583d23c17e 100644 (file)
@@ -644,9 +644,10 @@ void XGUI_OperationMgr::onOperationStopped()
 
 bool XGUI_OperationMgr::onKeyReleased(QObject *theObject, QKeyEvent* theEvent)
 {
+  bool isAccepted = false;
+
   // Let the manager decide what to do with the given key combination.
   ModuleBase_Operation* anOperation = currentOperation();
-  bool isAccepted = false;
   switch (theEvent->key()) {
     case Qt::Key_Tab:
     case Qt::Key_Backtab:
@@ -684,6 +685,8 @@ bool XGUI_OperationMgr::onKeyReleased(QObject *theObject, QKeyEvent* theEvent)
             aContext->HilightNextDetected(aView);
           else if ((theEvent->key() == Qt::Key_P))
             aContext->HilightPreviousDetected(aView);
+          aViewer->updateHighlight();
+          isAccepted = true;
         }
       }
     }
index 178b99ab2651ecef6f51c8fc203a59aaff53d424..f9f104ff35520301eef89e71353a813a8dacb191 100644 (file)
@@ -118,6 +118,8 @@ Q_OBJECT
   /// by mouse drugging. If this is impossible thet it has to return False.
   virtual bool canDragByMouse() const;
 
+  virtual void updateHighlight();
+
   // Fit all along Z (perpendicular to display)
   //virtual void Zfitall();
 
@@ -159,7 +161,6 @@ private slots:
  private:
    void displayHighlight();
    void eraseHighlight();
-   void updateHighlight();
 
   XGUI_Workshop* myWorkshop;
   ResultPtr myResult;