Using graphs in a Qt application [SOLVED]
-
wrote on 13 Oct 2013, 11:06 last edited by
Hi, I am developing a PetriNet Editor. The application will allow to construct and visualize the coverability graph of a drawn Petri Net. I used Qt containers to implement the graph algorithm but it seems very complicated.
Is there any solution or other Qt classes to do that ?
-
wrote on 14 Oct 2013, 12:19 last edited by
Hi,
What do you mean with
bq. I used Qt containers to implement the graph algorithm but it seems very complicated.
?
Qt containers are only data structures; the complexity of your algorithm is not depending from them.
-
wrote on 14 Oct 2013, 13:19 last edited by
Is there any tutoriel or example ?
-
wrote on 14 Oct 2013, 15:14 last edited by
Hi,
tutorial or example of what? PetriNet ot Qt Containers?
For the second you can start from "here":http://qt-project.org/doc/qt-5.1/qtdoc/topics-core.html#container-classes -
wrote on 14 Oct 2013, 21:17 last edited by
Hi mcosta :)
I think i will use the boost library !
thanks :)
-
wrote on 9 Nov 2013, 09:26 last edited by
Well,
After a long research in the web I find that the best way to use handle graph in a Qt application is :
- The boost graph library (BGL) to create and manipulate graphs and to output (serialize) a graph as a DOT file (graph.dot)
- The cgraph (GraphViz) library to parse the DOT file and create a graph layout.
- the Qt Graphic framework to visualize the graph!
-
wrote on 9 Nov 2013, 13:52 last edited by
Take a look at the following
You don't have to write out to dot, you can go straight from your graph to cgraph and then to qt. The link has all the source code to do so. Let me know if it helps.