Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

what differences between .qml file and qt design form file?



  • I new for Qt, I created two Qt projects, the first one named 'QtExample_1' use the 'Qt widgets Application' template, the second named 'QtExample_2' used the 'Qt Quick Application' template, In both projects, I found the differences between the two projects:
    In the QtExample_1 project, I found the Forms Directory, there is a mainwindow.ui file in the Forms Directory; in the QtExample_2 project, I found the Resource Directory, there is a qml.qrc file in the Resource Directory and the qml.qrc file includes a main.qml.
    it seems the main.qml file and the mainwindow.ui file has the same function which to display UI, now I have some question:
    1.what different between .qml file and qt design form file?
    2.can the .qml file and qt design form file transform each other?

    thanks a lot!


  • Lifetime Qt Champion

    @Princein Take a look at https://doc.qt.io/qt-5.12/qtqml-index.html
    QML is JavaScript based language to create graphical user interfaces. It is interpreted at runtime (like JavaScript).
    The designer form files (*.ui) are used for widget based applications (see https://doc.qt.io/qt-5.12/qtwidgets-index.html). Those contain the description of the graphical user interface and use XML. These files are used during compilation time to generate C++ code which is then compiled.


Log in to reply