+//=================================================================================
+// function : fitWindow()
+// purpose : scale the window considering a size of scene
+//=================================================================================
+void DependencyTree_View::fitWindow()
+{
+ int sizeFactor = 4;
+ if( objectsBoundingRect(true).width() > sizeFactor*size().width() ||
+ objectsBoundingRect(true).height() > sizeFactor*size().width() ) {
+ QRectF aRect = QRectF( -sizeFactor*size().width()/2, -sizeFactor*size().height()/2,
+ sizeFactor*size().width(), sizeFactor*size().height() );
+ fitInView( aRect, Qt::KeepAspectRatio );
+ }
+ else
+ fitAll();
+}
+