Creating UML Diagrams of a Qt application
-
wrote on 12 Sept 2011, 11:52 last edited by
Hi!
I'm looking for some tool to create class diagrams of qt applications. I tried various software like MS Visio, which i quite liked bcs of the "easy" GUI with not that much of unneeded features and stuff. But all of those tools where missing a nice and easy way to apply Qt elements in it - like data types as eg. QString and so on.
Anyone here has experience with creating UML diagrams for Qt apps?
-
wrote on 12 Sept 2011, 13:16 last edited by
I used "Umbrello":http://uml.sourceforge.net/ a few times. It can even import C++ headers defining classes. Unfortunately it was a bit on the crashy side and I had to make sure to save regularly:-)
-
wrote on 19 Sept 2011, 18:17 last edited by
I'm looking for the same tool.
It will be nice add to QtCreator.
Actually there are lot of things missing in QTCreator like:autocomplete of parent class in the dialogue to create new class
add the implementation for many functions in one click
changing one parameter name relflects immediately on the header file or cpp file it will be nice to implement
But the performance is still awesome.
-
wrote on 19 Sept 2011, 19:14 last edited by
[quote author="maherali" date="1316456224"]autocomplete of parent class in the dialogue to create new class[/quote]
We do have this, don't we?
[quote author="maherali" date="1316456224"]add the implementation for many functions in one click[/quote]
Hmm... what?
[quote author="maherali" date="1316456224"]changing one parameter name relflects immediately on the header file or cpp file it will be nice to implement[/quote]
Qt Creator does already support refactoring. Just right-click on a class or variable and select 'Refactoring'. -
wrote on 19 Sept 2011, 19:27 last edited by
bq. We do have this, don’t we?
when adding a new class using Add new item ... you will enter the class name, but when choosing the Base class, I want to choose QAbstractItemDelegate, it will be nice to autocomplete this, there is autocompletion for QObject, QWidget, QMainWindow, QDeclarativeItem (just these four)
bq. Hmm… what?
In header file try to write two functions f1,f2
Try to select both functions, and refactor: oops there is no Add Implementation
That's what I mean, it will be nice feature, usually I write the API prototype and then switch to CPP file to write the implementation, this way you will save yourself some navigations.bq. Qt Creator does already support refactoring
You are right about refactoring, and CTRL+SHIFT+R but it's not practical, when you rename a variable in method prototype (in header file) you would be asked to rename the symbol in all your project, and then filter it, which is obviously not practical in most cases.
There should be a smart behaviour: renaming the local variable, renaming the method parameter.Things that are very simple but will make QTCreator more productive.
By the way when you want to override a protected event it will be nice to add the return value of the sizeHint() and just put it there to be QSize.
-
wrote on 19 Sept 2011, 20:33 last edited by
So here is what i experienced so far:
I tried using several free, trial or open source tools for reverse/forward engineering. Non of them came even close to my expectations of a either easy to use or actually working tool for C++/Qt Code - mostly because reverse engineering for C++ is way more complicated compared to Java or C# and those free tools couldn't handle it.
I ended up using MS Visual Studio 2010 since i got it for free via MSDNAA (lucky me). There is not that much of features or options to play with for creating diagrams from code and vice versa. I'm hardly missing export to MS Visio or at least something besides image/pdf - but at least it works as i should :)
Comercial tools are way, way, way, waaaaaaay too expensive for personal use and for beginners impossible to understand because of the number of features and possibilities to use them.And my 2 cents for QtCreator: Awesome to work with, even with the lack of some "extended" features. But especially for Beginners and Semi-Pros the way to go when creating a Qt application!
-
wrote on 19 Sept 2011, 21:20 last edited by
[quote author="maherali" date="1316460461"]
In header file try to write two functions f1,f2
Try to select both functions, and refactor: oops there is no Add Implementation
That's what I mean, it will be nice feature, usually I write the API prototype and then switch to CPP file to write the implementation, this way you will save yourself some navigations.
[/quote]Set the cursor on the method name in the header and hit Alt-Return, Creator will then ask if a stub implementation should be added to the implementation .cpp. It does not work with selecting two methods though, but you can quickly switch back to the header using F4.
-
wrote on 20 Sept 2011, 05:52 last edited by
[quote author="Volker" date="1316467230"]Set the cursor on the method name in the header and hit Alt-Return, Creator will then ask if a stub implementation should be added to the implementation .cpp. It does not work with selecting two methods though, but you can quickly switch back to the header using F4.[/quote]
Do you know is there such functionality for adding a simple setter / getter implementation of a member variable too?
-
wrote on 20 Sept 2011, 05:55 last edited by
[quote author="maherali" date="1316460461"]when adding a new class using Add new item ... you will enter the class name, but when choosing the Base class, I want to choose QAbstractItemDelegate, it will be nice to autocomplete this, there is autocompletion for QObject, QWidget, QMainWindow, QDeclarativeItem (just these four)[/quote]
You can specify any base class, but for those four listed there will be additional code added (eg. the Q_OBJECT macro for QObject derived classes). But you are right - there is no auto-completion for currently known classes.
-
wrote on 20 Sept 2011, 06:50 last edited by
Lukas: Nope, no getter/setter support yet. Feel free to send in a merge request implementing it though:-)
-
wrote on 20 Sept 2011, 16:20 last edited by
Hi folks
I know these are simple things but it's really what attract people to Visual Studio. -
wrote on 20 Sept 2011, 17:45 last edited by
maherali: You greatly underestimate the complexity of the C++ language by calling those actions "simple things";-)
-
wrote on 10 Oct 2011, 18:30 last edited by
I know that it's not that simple because we have two files: header and cpp.
Actually it's very pleasant to work with QTCreator.