Tool to automatically create a class diagram for Qt application

Radwa picture Radwa · Jul 1, 2013 · Viewed 12.7k times · Source

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.

Answer

CapelliC picture CapelliC · Jul 1, 2013

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.