11

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

Jino
  • 345
  • 1
  • 2
  • 16
khajvah
  • 4,889
  • 9
  • 41
  • 63

2 Answers2

8

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

SirDarius
  • 41,440
  • 8
  • 86
  • 100
  • 1
    So What is the XML file that is created by default? – khajvah Jul 14 '13 at 15:56
  • 1
    UI files are used by the MOC compiler that generates the corresponding C++ classes. They are generated by tools such as QT Creator in order to ease the burden of creating user interfaces entirely through code, allowing you to use the nice graphical tools at your disposal instead. – SirDarius Jul 14 '13 at 16:01
4

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.

Clifford
  • 88,407
  • 13
  • 85
  • 165