Salome HOME
#refs 76 - reported by Hervé Legrand: Edit Sketch as Constructions child - crash
[modules/shaper.git] / src / XGUI / XGUI_ViewWindow.cpp
index 328b293061656ab1535535b6490e27dab22ab057..7c0bc5d9ac14c8c9e225178db90b52ae4344bf63 100644 (file)
@@ -679,8 +679,11 @@ void XGUI_ViewWindow::vpMousePressEvent(QMouseEvent* theEvent)
 //****************************************************************
 void XGUI_ViewWindow::contextMenuEvent(QContextMenuEvent* theEvent)
 {
-  QFrame::contextMenuEvent(theEvent);
-  emit contextMenuRequested(theEvent);
+  if (theEvent->modifiers() == Qt::NoModifier) {
+    // Temporary: has to be removed when viewer popup will be defined
+    //QFrame::contextMenuEvent(theEvent);
+    emit contextMenuRequested(theEvent);
+  }
 }
 
 //****************************************************************
@@ -724,7 +727,7 @@ void XGUI_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
       myCurrX = theEvent->x();
       myCurrY = theEvent->y();
       drawRect();
-      QRect rect = makeRect(myStartX, myStartY, myCurrX, myCurrY);
+      QRect rect = XGUI_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
       if (!rect.isEmpty())
         myViewPort->fitRect(rect);
       endDrawRect();
@@ -856,7 +859,7 @@ void XGUI_ViewWindow::drawRect()
   }
 
   myRectBand->setUpdatesEnabled(false);
-  QRect aRect = makeRect(myStartX, myStartY, myCurrX, myCurrY);
+  QRect aRect = XGUI_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
   myRectBand->initGeometry(aRect);
 
   if (!myRectBand->isVisible())
@@ -1036,7 +1039,7 @@ void XGUI_ViewWindow::dumpView()
     QApplication::setOverrideCursor( Qt::WaitCursor );
     QImage aPicture = myViewPort->dumpView();
 
-    QString aFmt = extension(aFileName).toUpper();
+    QString aFmt = XGUI_Tools::extension(aFileName).toUpper();
     if( aFmt.isEmpty() )
       aFmt = QString( "BMP" ); // default format
     else if( aFmt == "JPG" )