From 07cac98dddb5bf3f4c6705d53ef240abcf6e8e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Thu, 11 Jun 2009 13:37:45 +0200 Subject: Improve how graphviz (dotty) renders the serialized graph. The black arrow shows the principal direction based on the "origin" member of AnchorData. --- src/gui/graphicsview/qgraph_p.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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()); } -- cgit v0.12