Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.11+ : How to use Qt Quick Compiler? (Qt Open Source Version)
Forum Update on Monday, May 27th 2025

Qt 5.11+ : How to use Qt Quick Compiler? (Qt Open Source Version)

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 5 Posters 9.9k Views
  • 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.
  • S SGaist
    23 May 2018, 20:15

    Hi,

    The error you are posting looks completely unrelated to QtQuickCompiler. It rather looks like your Android development setup is somehow broken.

    I Offline
    I Offline
    Ibrahim
    wrote on 24 May 2018, 01:44 last edited by Ibrahim
    #3

    @SGaist It's compiling and running for Android when I remove CONFIG += qtquickcompiler from .pro file. There is no problem for Android settings.
    Edit: Interesting! I can compile it now.
    Well, how can I understand that is QtQuickCompiler running?

    S M 2 Replies Last reply 24 May 2018, 20:31
    1
    • I Ibrahim
      24 May 2018, 01:44

      @SGaist It's compiling and running for Android when I remove CONFIG += qtquickcompiler from .pro file. There is no problem for Android settings.
      Edit: Interesting! I can compile it now.
      Well, how can I understand that is QtQuickCompiler running?

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 May 2018, 20:31 last edited by
      #4

      @Ibrahim said in Qt 5.11+ : How to use Qt Quick Compiler? (Qt Open Source Version):

      Well, how can I understand that is QtQuickCompiler running?

      I don't understand that question, can you rephrase it ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply 25 May 2018, 01:42
      1
      • S SGaist
        24 May 2018, 20:31

        @Ibrahim said in Qt 5.11+ : How to use Qt Quick Compiler? (Qt Open Source Version):

        Well, how can I understand that is QtQuickCompiler running?

        I don't understand that question, can you rephrase it ?

        I Offline
        I Offline
        Ibrahim
        wrote on 25 May 2018, 01:42 last edited by
        #5

        @SGaist
        I mean I wrote CONFIG += qtquickcompiler and compiled but what changed?
        Example of:
        If I compiled my app for desktop without CONFIG += qtquickcompiler, result is this:
        alt text
        If I compiled my app for desktop with CONFIG += qtquickcompiler, result is this:
        alt text
        If I compiled my app for Android without CONFIG += qtquickcompiler, result is this:
        alt text
        If I compiled my app for Android with CONFIG += qtquickcompiler, result is this:
        alt text
        I don't understand that what happened when I put CONFIG += qtquickcompiler parameter? Because both with QtQuickCompiler and without QtQuickCompiler I can see QML files (such as OpacityMask.qml) and shared files (such as libQt5Core.so). I have read QtQuickCompiler documentation and it says:

        The Qt Quick Compiler is a development add-on for Qt Quick applications which allows you to compile QML source code into the final binary.

        But I can see there iare still QML files and libQt5xxx.so files.

        R 1 Reply Last reply 25 May 2018, 11:01
        0
        • I Ibrahim
          25 May 2018, 01:42

          @SGaist
          I mean I wrote CONFIG += qtquickcompiler and compiled but what changed?
          Example of:
          If I compiled my app for desktop without CONFIG += qtquickcompiler, result is this:
          alt text
          If I compiled my app for desktop with CONFIG += qtquickcompiler, result is this:
          alt text
          If I compiled my app for Android without CONFIG += qtquickcompiler, result is this:
          alt text
          If I compiled my app for Android with CONFIG += qtquickcompiler, result is this:
          alt text
          I don't understand that what happened when I put CONFIG += qtquickcompiler parameter? Because both with QtQuickCompiler and without QtQuickCompiler I can see QML files (such as OpacityMask.qml) and shared files (such as libQt5Core.so). I have read QtQuickCompiler documentation and it says:

          The Qt Quick Compiler is a development add-on for Qt Quick applications which allows you to compile QML source code into the final binary.

          But I can see there iare still QML files and libQt5xxx.so files.

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 25 May 2018, 11:01 last edited by
          #6

          @Ibrahim
          IIRC you dont see any result directly.
          Your qml files are in-place replaced with .qmlc files in the final qrc binary.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          I 1 Reply Last reply 25 May 2018, 19:36
          3
          • R raven-worx
            25 May 2018, 11:01

            @Ibrahim
            IIRC you dont see any result directly.
            Your qml files are in-place replaced with .qmlc files in the final qrc binary.

            I Offline
            I Offline
            Ibrahim
            wrote on 25 May 2018, 19:36 last edited by Ibrahim
            #7

            @raven-worx

            final qrc binary

            What do you mean? I compiled my app with release mode but apk still includes xxx.qml files and libQt5xxx.so. I can't see qmlc files.

            R 1 Reply Last reply 27 May 2018, 07:44
            0
            • I Ibrahim
              25 May 2018, 19:36

              @raven-worx

              final qrc binary

              What do you mean? I compiled my app with release mode but apk still includes xxx.qml files and libQt5xxx.so. I can't see qmlc files.

              R Offline
              R Offline
              raven-worx
              Moderators
              wrote on 27 May 2018, 07:44 last edited by raven-worx
              #8

              @Ibrahimthe
              files specified in the qrc file are compiled into a cpp file by the rcc tool implicitly. thats how they are embedded into your app

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              I 1 Reply Last reply 27 May 2018, 10:28
              2
              • R raven-worx
                27 May 2018, 07:44

                @Ibrahimthe
                files specified in the qrc file are compiled into a cpp file by the rcc tool implicitly. thats how they are embedded into your app

                I Offline
                I Offline
                Ibrahim
                wrote on 27 May 2018, 10:28 last edited by
                #9

                @raven-worx Well, does QtQuikcCompiler remove libQt5xxx.so files and XXX.qml files in my apk files or desktop app? Because I can still see libQt5xxx.so and XXX.qml files in my apk file. I can see qmlcache_loader.cpp and qmlcache_loader.o files in my desktop app. Do you mean these files?
                I mean it's enough when I write CONFIG += qtquickcompiler parameter in .pro file? Don't the libQt5xxx.so and XXX.qml files from my apk have to be disappear when I compiled with CONFIG += qtquickcompiler parameter?

                R 1 Reply Last reply 27 May 2018, 16:20
                0
                • I Ibrahim
                  27 May 2018, 10:28

                  @raven-worx Well, does QtQuikcCompiler remove libQt5xxx.so files and XXX.qml files in my apk files or desktop app? Because I can still see libQt5xxx.so and XXX.qml files in my apk file. I can see qmlcache_loader.cpp and qmlcache_loader.o files in my desktop app. Do you mean these files?
                  I mean it's enough when I write CONFIG += qtquickcompiler parameter in .pro file? Don't the libQt5xxx.so and XXX.qml files from my apk have to be disappear when I compiled with CONFIG += qtquickcompiler parameter?

                  R Offline
                  R Offline
                  raven-worx
                  Moderators
                  wrote on 27 May 2018, 16:20 last edited by raven-worx
                  #10

                  @Ibrahim
                  are your qml files not in a qrc? But in the file system?
                  See here

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  I 1 Reply Last reply 27 May 2018, 18:51
                  1
                  • R raven-worx
                    27 May 2018, 16:20

                    @Ibrahim
                    are your qml files not in a qrc? But in the file system?
                    See here

                    I Offline
                    I Offline
                    Ibrahim
                    wrote on 27 May 2018, 18:51 last edited by
                    #11

                    @raven-worx
                    Yes, main.qml file is in the qrc. It's in qrc as default when I create an QQC2 project. Should I move main.qml to another qrc? I have not another qml files but just main.qml.

                    1 Reply Last reply
                    0
                    • I Ibrahim
                      24 May 2018, 01:44

                      @SGaist It's compiling and running for Android when I remove CONFIG += qtquickcompiler from .pro file. There is no problem for Android settings.
                      Edit: Interesting! I can compile it now.
                      Well, how can I understand that is QtQuickCompiler running?

                      M Offline
                      M Offline
                      Magnus21
                      wrote on 25 Dec 2018, 12:45 last edited by
                      #12

                      @Ibrahim said in Qt 5.11+ : How to use Qt Quick Compiler? (Qt Open Source Version):

                      Well, how can I understand that is QtQuickCompiler running?

                      Since I think, that this is still not properly answered, here is a way to test, if your build used the Qt Quick compiler:

                      A benefit of the Qt Quick compiler, is that syntax errors are checked during compilation.

                      So you can just put some invalid QML syntax in your qml file and test if the build finds the error during compilation (then you are using the compiler) or if the error is only found when running the application (then you are using the interpreter).

                      So. e.g. put the following at the top of your main.qml and see what happens:

                      imports asdf
                      
                      1 Reply Last reply
                      2
                      • T Offline
                        T Offline
                        ToniHMH
                        wrote on 22 Apr 2019, 13:35 last edited by
                        #13

                        @Ibrahim said in Qt 5.11+ : How to use Qt Quick Compiler? (Qt Open Source Version):

                        Well, how can I understand that is QtQuickCompiler running?

                        Since I think, that this is still not properly answered, here is a way to test, if your build used the Qt Quick compiler:

                        A benefit of the Qt Quick compiler, is that syntax errors are checked during compilation.

                        So you can just put some invalid QML syntax in your qml file and test if the build finds the error during compilation (then you are using the compiler) or if the error is only found when running the application (then you are using the interpreter).

                        So. e.g. put the following at the top of your main.qml and see what happens:

                        imports asdf

                        This trick worked fine for me. In my case my problem was that I was still using in my compilation options Qt5.10, after that I have to configure CONFIG += qtquickcompiler in the build steps inside qt.

                        I added CONFIG += qtquickcompiler parameter to .pro file but I get this error message when I compile my app:

                        I think that this was your error, you should not define it on .pro but in the compile options steps for qmake. I can even see checkbox that indicates me if the compiler is enabled or not.
                        Th

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved