Total newbie - is QML compiled



  • I'm completely a newbie with QT (I have programmed in Python in the past). I know QT is normally C++ and compiled. I watched a video on the new QT 5.1 that showed QT QUICK 2.0. The interesting thing is no C++ code was written - only QT QUICK code. The question - if I create a QT QUICK only app is the app compiled? Does it run in some sort of JIT (like JavaScript). I'd like to deploy something like an '.exe'? Can that be done just using QT QUICK?



  • There is a detail blog post answering this. It is the first of a 4 part series.

    http://www.kdab.com/qml-engine-internals-part-1-qml-file-loading/



  • The .qml files are not compiled to machine code but the qt library comes with a jit-based javascript engine included. To make a stand alone executable from qml, you can create a basic cpp application and simply point it to your qml files. The following snippet shows the minimum amount of c++ code needed to set up and run a qml application:

    @#include <QApplication>
    #include <QQmlApplicationEngine>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QQmlApplicationEngine engine("main.qml");
    return app.exec();
    }@

    The qml files themselves can also be embedded into the executable. When deploying you would also usually ship the Qt .dlls together with your application.



  • Thanks folks - the link looks like a very interesting (and educational) read.
    Johnf


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.