Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt: UI with c++ vs with xml vs with qml

Tags:

c++

xml

qt

qml

qt5.1

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

like image 297
khajvah Avatar asked Jul 14 '13 15:07

khajvah


People also ask

What is the difference between Qt and QML?

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.

Which one you would prefer for GUI development Qt widget or Qt QML?

When you plan to target desktop systems, go with QtWidgets. If you want to go for mobile devices, go with QML.

Why should I use 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.

Does Qt use XML?

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.


1 Answers

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

like image 56
SirDarius Avatar answered Oct 01 '22 14:10

SirDarius