myIsSketchingByPath( false ),
myIsDragging( false ),
myIsDragPositionInitialized( false ),
+ myDraggingSelectedByLeftButton( false ),
myIsPulling( false ),
myPullingObject( 0 ),
myStoredCursor( Qt::ArrowCursor ),
return myIsSketching;
}
+//================================================================
+// Function : setDraggingSelectedByLeftButton
+// Purpose :
+//================================================================
+void GraphicsView_ViewPort::setDraggingSelectedByLeftButton( const bool& theValue )
+{
+ myDraggingSelectedByLeftButton = theValue;
+}
+
//================================================================
// Function : dragObjects
// Purpose :
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() )
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();
// dragging
bool isDragging() { return myIsDragging; }
+ bool isDraggingSelectedByLeftButton() const { return myDraggingSelectedByLeftButton; }
+ void setDraggingSelectedByLeftButton( const bool& theValue );
+
// pulling
bool startPulling( const QPointF& );
void drawPulling( const QPointF& );
int myIsDragging;
QPointF myDragPosition;
bool myIsDragPositionInitialized;
+ bool myDraggingSelectedByLeftButton;
// pulling
bool myIsPulling;
}
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() );