X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGraphicsView%2FGraphicsView_ViewPort.cxx;fp=src%2FGraphicsView%2FGraphicsView_ViewPort.cxx;h=f18cd1e6c75cc66a67c78b383f4db81742e604ea;hb=fc9bbad61518ca4f1a226fbed4fd1c29613c1388;hp=93e75b461dba58878b061181b951015a6478b8ea;hpb=7630c6fc03d9dbf6e68d0b6e95188afd5352fff1;p=modules%2Fgui.git diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index 93e75b461..f18cd1e6c 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -147,6 +147,7 @@ GraphicsView_ViewPort::GraphicsView_ViewPort( QWidget* theParent ) myIsSketchingByPath( false ), myIsDragging( false ), myIsDragPositionInitialized( false ), + myDraggingSelectedByLeftButton( false ), myIsPulling( false ), myPullingObject( 0 ), myStoredCursor( Qt::ArrowCursor ), @@ -1508,6 +1509,15 @@ bool GraphicsView_ViewPort::isSketching( bool* theIsPath ) const return myIsSketching; } +//================================================================ +// Function : setDraggingSelectedByLeftButton +// Purpose : +//================================================================ +void GraphicsView_ViewPort::setDraggingSelectedByLeftButton( const bool& theValue ) +{ + myDraggingSelectedByLeftButton = theValue; +} + //================================================================ // Function : dragObjects // Purpose : @@ -1535,8 +1545,9 @@ void GraphicsView_ViewPort::dragObjects( QGraphicsSceneMouseEvent* e ) else anObjectsToMove.append( anObject ); } - else if( hasInteractionFlag( DraggingByMiddleButton ) && - nbSelected() && ( e->buttons() & Qt::MidButton ) ) + else if( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) || + isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) && + nbSelected() ) { for( initSelected(); moreSelected(); nextSelected() ) if( GraphicsView_Object* aMovingObject = selectedObject() ) @@ -1731,8 +1742,9 @@ void GraphicsView_ViewPort::onMouseEvent( QGraphicsSceneMouseEvent* e ) if( ( getHighlightedObject() && getHighlightedObject()->isMovable() && !( anAccel || e->button() != Qt::LeftButton ) ) || - ( hasInteractionFlag( DraggingByMiddleButton ) && - nbSelected() && !anAccel && e->button() == Qt::MidButton ) ) + ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton || + isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) && + nbSelected() && !anAccel ) ) { myIsDragging = true; myStoredCursor = cursor();