From f80d255d26b085e58fcd8c00dd60ed210eae7773 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 23 Nov 2010 11:53:41 +0000 Subject: [PATCH] Objects' dragging mechanism --- src/GraphicsView/GraphicsView_ViewPort.cxx | 5 +++-- src/GraphicsView/GraphicsView_ViewPort.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index f9ede1288..44dde4656 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -1105,6 +1105,8 @@ void GraphicsView_ViewPort::onMouseEvent( QGraphicsSceneMouseEvent* e ) { if( !isPulling() && myIsDragging ) { + emit vpObjectBeforeMoving(); + bool anIsMoved = false; for( initSelected(); moreSelected(); nextSelected() ) if( GraphicsView_Object* aMovingObject = selectedObject() ) @@ -1116,8 +1118,7 @@ void GraphicsView_ViewPort::onMouseEvent( QGraphicsSceneMouseEvent* e ) myIsDragging = false; myDragPosition = QPointF(); - if( anIsMoved ) - emit vpObjectMoved(); + emit vpObjectAfterMoving( anIsMoved ); } break; } diff --git a/src/GraphicsView/GraphicsView_ViewPort.h b/src/GraphicsView/GraphicsView_ViewPort.h index c5e7be216..d6de601f5 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.h +++ b/src/GraphicsView/GraphicsView_ViewPort.h @@ -160,7 +160,8 @@ signals: void vpWheelEvent( QGraphicsSceneWheelEvent* ); void vpContextMenuEvent( QGraphicsSceneContextMenuEvent* ); - void vpObjectMoved(); + void vpObjectBeforeMoving(); + void vpObjectAfterMoving( bool ); private: void initialize(); -- 2.39.2