Salome HOME
Merge remote branch 'origin/V7_dev'
[modules/gui.git] / src / GraphicsView / GraphicsView_Object.cxx
index 52447dcb53f372a8a4f9569840d436dd4229d2e1..867ee5efb3cd05adfd3c497135b425aa42e1f8a3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,8 @@ GraphicsView_Object::GraphicsView_Object( QGraphicsItem* theParent )
   myIsOnTop( false ),
   myIsHighlighted( false ),
   myIsSelected( false ),
-  myIsMoving( false )
+  myIsMoving( false ),
+  myIsMovable( true )
 {
 }
 
@@ -42,7 +43,7 @@ GraphicsView_Object::GraphicsView_Object( QGraphicsItem* theParent )
 //=======================================================================
 GraphicsView_Object::~GraphicsView_Object()
 {
-  QListIterator<QGraphicsItem*> aChildIter( children() );
+  QListIterator<QGraphicsItem*> aChildIter( childItems() );
   while( aChildIter.hasNext() )
   {
     if( QGraphicsItem* aChild = aChildIter.next() )
@@ -156,6 +157,9 @@ void GraphicsView_Object::unselect()
 //================================================================
 void GraphicsView_Object::move( double theDX, double theDY, bool theIsAtOnce )
 {
+  if( !myIsMovable )
+    return;
+
   if( theIsAtOnce )
   {
     finishMove( true );