Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved CONFIG += qtquickcompiler doesn't seem to work

    QML and Qt Quick
    qml precompile qtquickcompiler qt5.9
    4
    5
    4569
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Naveen_AC last edited by

      Hi

      I created a project in Qt Creator. Added CONFIG += qtquickcompiler to the .pro file in order to compile my .qml files in to .cpp and then compile them into the binary. When I build, I don't see any corresponding .cpp files for my .qml files in the build directory. How do I know if this is even using qtquickcompiler to compile .qml files? I don't see any sign of it in the compile output either.

      I am using Qt 5.9/msvc2015

      Marco Pellin 1 Reply Last reply Reply Quote 0
      • D
        DBoosalis last edited by

        I think the compiler just generates .qmlc files which are binary and not source files
        http://doc.qt.io/QtQuickCompiler/

        1 Reply Last reply Reply Quote 0
        • N
          Naveen_AC last edited by

          No. That is what happens if you don't use qtquickcompiler or resourcecompiler. By default, qt uses JIT compiler to convert qml into machine code on the fly, but this adds to the load time when the app is loaded first time. You can see .qmlc files in the same folder as your .qml files during run time. This is what I am trying to avoid.

          I want to use qtquickcompiler to compile during build time and add it to executable binary. But when I build, my project is using rcc.exe to compile the qml into the binary directly.

          1 Reply Last reply Reply Quote 0
          • Marco Pellin
            Marco Pellin @Naveen_AC last edited by

            @Naveen_AC
            I guess that Qt Quick Compiler is available for commercial license only.
            I don't know if this is the case.

            Qt 5.9 also comes with a brand new QML caching infrastructure, offering similar benefits to our users — just like the commercially available Qt Quick Compiler, but in a much more transparent way.
            (Taken from Qt 5.9 released)

            1 Reply Last reply Reply Quote 0
            • P
              Pixelgrease last edited by

              Release builds using the QtQuick compiler generate a qtquickcompiler_loader.cpp file and *_qml.cpp files where * matches the name of your individual *.qml files all within a ".qtquickcompiler" folder within the "build-*-Release" output folder. I verified this with a commercial license Qt 5.9.

              Debugging QML is not compatible with the QtQuick compiler; using default settings to build a Debug executable will not use the QtQuick compiler.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post