From: ouv Date: Tue, 22 Mar 2011 10:47:50 +0000 (+0000) Subject: setTraceBoundingRectEnabled( bool ) method is added. X-Git-Tag: DIAGRAM_1_0~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eb1e9d222db9b6df1bf66af4b6c287d4e89ca13a;p=modules%2Fgui.git setTraceBoundingRectEnabled( bool ) method is added. --- diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index d066402c3..442fc9281 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -143,6 +143,7 @@ GraphicsView_ViewPort::GraphicsView_ViewPort( QWidget* theParent ) mySceneGap = 20; myFitAllGap = 40; + myIsTraceBoundingRectEnabled = true; // background setBackgroundBrush( QBrush( Qt::white ) ); @@ -348,6 +349,15 @@ void GraphicsView_ViewPort::setFitAllGap( double theFitAllGap ) myFitAllGap = theFitAllGap; } +//================================================================ +// Function : setTraceBoundingRectEnabled +// Purpose : +//================================================================ +void GraphicsView_ViewPort::setTraceBoundingRectEnabled( bool theState ) +{ + myIsTraceBoundingRectEnabled = theState; +} + //================================================================ // Function : setViewNameEnabled // Purpose : @@ -1247,8 +1257,11 @@ void GraphicsView_ViewPort::finishPulling() //================================================================ void GraphicsView_ViewPort::onBoundingRectChanged() { - QRectF aRect = objectsBoundingRect(); - myScene->setSceneRect( aRect.adjusted( -mySceneGap, -mySceneGap, mySceneGap, mySceneGap ) ); + if( myIsTraceBoundingRectEnabled ) + { + QRectF aRect = objectsBoundingRect(); + myScene->setSceneRect( aRect.adjusted( -mySceneGap, -mySceneGap, mySceneGap, mySceneGap ) ); + } } //================================================================ diff --git a/src/GraphicsView/GraphicsView_ViewPort.h b/src/GraphicsView/GraphicsView_ViewPort.h index 2d95dfacc..0b97494f0 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.h +++ b/src/GraphicsView/GraphicsView_ViewPort.h @@ -82,6 +82,7 @@ public: // scene void setSceneGap( double theSceneGap ); void setFitAllGap( double theFitAllGap ); + void setTraceBoundingRectEnabled( bool theState ); // view name void setViewNamePosition( NamePosition thePosition, @@ -216,6 +217,7 @@ private: GraphicsView_Scene* myScene; double mySceneGap; double myFitAllGap; + bool myIsTraceBoundingRectEnabled; // view name NameLabel* myNameLabel;