I have started learning qt today and have a question. When I create a project, it comes with *.ui file which is XML kind of file but in the book, I am only creating UI with pure c++(classes). I have heard there is another way of creating the UI with qml.
So, What are pros and cons of each UI creating way?
Thanks in advance
EDIT: I am using QT 5.1.0
Don't forget that you can also embed a QtWebkit view and use HTML directly as the user interface controls.
A lengthy answer with the specifics of each sub-framework could be provided, but the QT project people have already answered this question with a chart of their own:
http://qt-project.org/doc/qt-5.1/qtdoc/topics-ui.html#comparison
The .ui file is generated for/by "visual" design layout tools such as QtDesigner - I would not suggest you generate or edit them by hand; if you choose not to use "visual" or "RAD" GUI design tools then programmatically instantiating widgets in C++ is probably fine.
来源:https://stackoverflow.com/questions/17640887/qt-ui-with-c-vs-with-xml-vs-with-qml