Salome HOME
Support both 5.5 and 5.6 version of ParaView
[modules/gui.git] / src / GraphicsView / GraphicsView_Viewer.cxx
index a8e1511b2c360aec3bb3d834f2eda335abd788f5..cc55ba5d7361d6457e0bc8f6f97680ee21e72fc0 100644 (file)
@@ -68,13 +68,18 @@ GraphicsView_Viewer::~GraphicsView_Viewer()
   delete mySelector;
 }
 
+GraphicsView_ViewFrame* GraphicsView_Viewer::createViewFrame( SUIT_Desktop* theDesktop, QWidget* theWidget )
+{
+  return new GraphicsView_ViewFrame( theDesktop, this, theWidget );
+}
+
 //================================================================
 // Function : createView
 // Purpose  : 
 //================================================================
 SUIT_ViewWindow* GraphicsView_Viewer::createView( SUIT_Desktop* theDesktop )
 {
-  GraphicsView_ViewFrame* aViewFrame = new GraphicsView_ViewFrame( theDesktop, this, myWidget );
+  GraphicsView_ViewFrame* aViewFrame = createViewFrame( theDesktop, myWidget );
 
   connect( aViewFrame, SIGNAL( keyPressed( QKeyEvent* ) ),
            this, SLOT( onKeyEvent( QKeyEvent* ) ) );
@@ -401,7 +406,9 @@ void GraphicsView_Viewer::handleMousePress( QGraphicsSceneMouseEvent* e )
       }
       else if( e->button() == Qt::LeftButton &&
                !( aViewPort->currentBlock() & GraphicsView_ViewPort::BS_Selection ) &&
-               !aViewPort->getHighlightedObject() )
+               !aViewPort->getHighlightedObject() &&
+               ( !aViewPort->isDraggingSelectedByLeftButton() ||
+                 aViewPort->isDraggingSelectedByLeftButton() && aViewPort->nbSelected() == 0 ) )
       {
         // Start rectangular selection if pulling was not started
         QPoint p = aViewPort->mapFromScene( e->scenePos() );