summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraph_p.h
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-06-11 11:37:45 (GMT)
committerEduardo M. Fleury <eduardo.fleury@openbossa.org>2009-07-22 18:04:27 (GMT)
commit07cac98dddb5bf3f4c6705d53ef240abcf6e8e90 (patch)
tree97677d94d811be61da2dca264a0b52f555454a71 /src/gui/graphicsview/qgraph_p.h
parentf5dc6a07fb9eb99211eb1fa3056a51b933ac3430 (diff)
downloadQt-07cac98dddb5bf3f4c6705d53ef240abcf6e8e90.zip
Qt-07cac98dddb5bf3f4c6705d53ef240abcf6e8e90.tar.gz
Qt-07cac98dddb5bf3f4c6705d53ef240abcf6e8e90.tar.bz2
Improve how graphviz (dotty) renders the serialized graph.
The black arrow shows the principal direction based on the "origin" member of AnchorData.
Diffstat (limited to 'src/gui/graphicsview/qgraph_p.h')
-rw-r--r--src/gui/graphicsview/qgraph_p.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraph_p.h b/src/gui/graphicsview/qgraph_p.h
index 6f4d7bd..63ba53b 100644
--- a/src/gui/graphicsview/qgraph_p.h
+++ b/src/gui/graphicsview/qgraph_p.h
@@ -131,7 +131,16 @@ public:
for (int i = 0; i < adjacents.count(); ++i) {
Vertex *v1 = adjacents.at(i);
EdgeData *data = edgeData(v, v1);
- edges += QString::fromAscii("%1->%2 [label=\"[%3,%4]\"]\n").arg(v->toString()).arg(v1->toString()).arg(data->minSize).arg(data->maxSize);
+ bool forward = data->origin == v;
+ if (forward) {
+ edges += QString::fromAscii("%1->%2 [label=\"[%3,%4]\" dir=both color=\"#000000:#a0a0a0\"] \n")
+ .arg(v->toString())
+ .arg(v1->toString())
+ .arg(data->minSize)
+ .arg(data->maxSize)
+ ;
+ }
+
}
strVertices += QString::fromAscii("%1 [label=\"%2\"]\n").arg(v->toString()).arg(v->toString());
}