Tool to automatically create a class diagram for Qt application

15.4k views Asked by At

I am having a problem finding a tool to create a UML class diagram for my Qt application.

I tried both BOUML and Umbrello, but both of them have problems with some classes.

I am working on Ubuntu.

2

There are 2 answers

2
CapelliC On

doxygen can build a lot of diagrams (inheritance, collaboration, even callflow), I think you should try it.

I used it in the past, and even if didn't commented the code as required, it was able to produce very nice (albeit complicated) diagrams.

Citing from Features section of online docs:

  • Uses the dot tool of the Graphviz tool kit to generate include dependency graphs, collaboration diagrams, call graphs, directory structure graphs, and graphical class hierarchy graphs.

  • Automatically detects public, protected and private sections, as well as the Qt specific signal and slots sections. Extraction of private class members is optional.

Although doxygen can now be used in any project written in a language that is supported by doxygen, initially it was specifically designed to be used for projects that make use of Qt Software's Qt toolkit. I have tried to make doxygen `Qt-compatible'. That is: Doxygen can read the documentation contained in the Qt source code and create a class browser that looks quite similar to the one that is generated by Qt Software. Doxygen understands the C++ extensions used by Qt such as signals and slots and many of the markup commands used in the Qt sources.

0
Bruce On

Enterprise Architect from Sparx Systems can import C++ code. The diagrams are very good and the tools supports round-tripping (editing diagram and generating code). It is interesting to see what it does with the moc_*.cpp files, but you will probably want to delete those from your model.