summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-06-03 10:58:07 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-07-22 18:04:23 (GMT)
commit072a9595a308df9b8e7a547c370ce54ab5af6ed4 (patch)
treebc95701fb6e200b1317cf8d6ea7ae490ecca71ce /src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
parentb58d43e407029f19d313cdc2314cf114c572f692 (diff)
downloadQt-072a9595a308df9b8e7a547c370ce54ab5af6ed4.zip
Qt-072a9595a308df9b8e7a547c370ce54ab5af6ed4.tar.gz
Qt-072a9595a308df9b8e7a547c370ce54ab5af6ed4.tar.bz2
Some cleanup - improve dot dumper.
The previous dumper relied on traversal of the graph, which meant that it would not output the nodes that were not connected to the "main" graph. Due to this, we cannot rely on traversal, so instead we must iterate through all the vertices of the graph. As an added bonus the code gets simpler :-) There was also a problem with the previous dumper, since it dumped two "digraph" elements into one file. Graphwiz (win32) did not handle that. Instead just dump all the nodes and all the connections, both horizontal and vertical ones. The horizontal and vertical connections are never connected anyway, so the result will be two separate graphs when it is rendered by graphwiz. Also renamed firstVertex to rootVertex and simplified it.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index 644ed6b..add2db3 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -681,8 +681,7 @@ void QGraphicsAnchorLayoutPrivate::findPaths(Orientation orientation)
QSet<AnchorData *> visited;
- bool ok;
- AnchorVertex *root = graph[orientation].firstVertex(&ok);
+ AnchorVertex *root = graph[orientation].rootVertex();
graphPaths[orientation].insert(root, GraphPath());
@@ -889,8 +888,7 @@ void QGraphicsAnchorLayoutPrivate::calculateVertexPositions(
QSet<AnchorVertex *> visited;
// Get root vertex
- bool ok;
- AnchorVertex *root = graph[orientation].firstVertex(&ok);
+ AnchorVertex *root = graph[orientation].rootVertex();
qreal widgetMargin;
qreal layoutMargin;