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
QML is the language; its JavaScript runtime is the custom V4 engine, since Qt 5.2; and Qt Quick is the 2D scene graph and the UI framework based on it. These are all part of the Qt Declarative module, while the technology is no longer called Qt Declarative.
When you plan to target desktop systems, go with QtWidgets. If you want to go for mobile devices, go with QML.
It allows developers and designers alike to create highly performant, fluidly animated and visually appealing applications. QML offers a highly readable, declarative, JSON-like syntax with support for imperative JavaScript expressions combined with dynamic property bindings.
Qt provides two general-purpose sets of APIs to read and write well-formed XML: stream based and DOM based. Qt also provides specific support for some XML dialects.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With