Using graphs in a Qt application [SOLVED]
-
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 ?
-
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 -
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!
-
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.