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,
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.
-
Is there any tutoriel or example ?
-
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 -
Hi mcosta :)
I think i will use the boost library !
thanks :)
-
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.