]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provided context menu event in view window
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 13 May 2014 15:35:49 +0000 (19:35 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 13 May 2014 15:35:49 +0000 (19:35 +0400)
src/XGUI/XGUI_ViewWindow.cpp
src/XGUI/XGUI_ViewWindow.h

index 44b64c985d201d65ab8ae591e6401ca298d0df43..328b293061656ab1535535b6490e27dab22ab057 100644 (file)
@@ -295,7 +295,6 @@ XGUI_ViewWindow::XGUI_ViewWindow(XGUI_Viewer* theViewer, V3d_TypeOfView theType)
   connect(myViewPort, SIGNAL(vpUpdated()), this, SLOT(updateToolBar()));
   connect(this, SIGNAL(vpTransformationFinished(XGUI_ViewWindow::OperationType)), 
           this, SLOT(updateToolBar()));
-
 }
 
 //****************************************************************
@@ -677,6 +676,13 @@ void XGUI_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
    l_mbPressEvent = new QMouseEvent( *theEvent );*/
 }
 
+//****************************************************************
+void XGUI_ViewWindow::contextMenuEvent(QContextMenuEvent* theEvent)
+{
+  QFrame::contextMenuEvent(theEvent);
+  emit contextMenuRequested(theEvent);
+}
+
 //****************************************************************
 void XGUI_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 {
@@ -693,10 +699,6 @@ void XGUI_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
      }
      */
     emit mouseReleased(this, theEvent);
-    if (theEvent->button() == Qt::RightButton && prevState == -1) {
-      QContextMenuEvent aEvent(QContextMenuEvent::Mouse, theEvent->pos(), theEvent->globalPos());
-      emit contextMenuRequested(&aEvent);
-    }
   }
     break;
   case ROTATE:
index 554eee47b04270156537a074c3ce600742a3369a..65c2ae273cc87b9c50a25f7636d97de8515aff75 100644 (file)
@@ -195,6 +195,8 @@ protected:
 
   virtual void showEvent(QShowEvent* theEvent);
 
+  virtual void contextMenuEvent(QContextMenuEvent* theEvent);
+
 private slots:
   void onClose();
   void onMinimize();