From fd8c247f5fcf56c2dfe65c6dc88e6cc39ae1ea44 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Thu, 13 Aug 2009 17:05:15 -0300 Subject: QGraphicsAnchorLayout: enable simplification Enable simplification by default. Allow disable during runtime by using the environment variable QT_ANCHORLAYOUT_NO_SIMPLIFICATION=1 when running the code. Signed-off-by: Caio Marcelo de Oliveira Filho --- src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index de14c31..09fe1b9 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1127,7 +1127,9 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( // However, as the two setAnchorSizeHints methods above are not // ready to be run on top of a simplified graph, we must simplify // and restore it every time we get here. - //simplifyGraph(orientation); + static bool simplification = qgetenv("QT_ANCHORLAYOUT_NO_SIMPLIFICATION").isEmpty(); + if (simplification) + simplifyGraph(orientation); // Traverse all graph edges and store the possible paths to each vertex findPaths(orientation); @@ -1256,6 +1258,9 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs( qDeleteAll(constraints[orientation]); constraints[orientation].clear(); graphPaths[orientation].clear(); // ### + + if (simplification) + restoreSimplifiedGraph(orientation); } /*! -- cgit v0.12