]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Objects' dragging mechanism
authorouv <ouv@opencascade.com>
Tue, 23 Nov 2010 11:53:41 +0000 (11:53 +0000)
committerouv <ouv@opencascade.com>
Tue, 23 Nov 2010 11:53:41 +0000 (11:53 +0000)
src/GraphicsView/GraphicsView_ViewPort.cxx
src/GraphicsView/GraphicsView_ViewPort.h

index f9ede1288450dbe0b8b5222efacd825c2c32ba88..44dde465633ee83dca0204d08ef717e123ac4a78 100644 (file)
@@ -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;
     }
index c5e7be2168f2fa4760268828e7cf56ff20883ed4..d6de601f5e9c326603a6a3160b3eb15f322272ac 100644 (file)
@@ -160,7 +160,8 @@ signals:
   void                             vpWheelEvent( QGraphicsSceneWheelEvent* );
   void                             vpContextMenuEvent( QGraphicsSceneContextMenuEvent* );
 
-  void                             vpObjectMoved();
+  void                             vpObjectBeforeMoving();
+  void                             vpObjectAfterMoving( bool );
 
 private:
   void                             initialize();