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)
QtWS25 Last Chance

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.8k 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.
  • I Offline
    I Offline
    Ibrahim
    wrote on last edited by
    #1

    Hi. I have seen Qt 5.11+ supports QtQuickCompiler anymore: http://doc.qt.io/qt-5/whatsnew511.html#qt-qml-module
    I read QtQuickCompiler documentation but I can't use it. The documentation says:

    Create a .qrc file for your application and include all the files your project needs, including .qml , .js and qmldir files.

    But there is already an qml.qrc file when we create an qqc2 project:
    alt text
    I added CONFIG += qtquickcompiler parameter to .pro file but I get this error message when I compile my app:

    Cannot find the androiddeploy Json file.
    Error while building/deploying project qqc2-test-project (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.11.0 for Android armv7))
    When executing step "Deploy to Android device"
    

    It is compiling when I choose Desktop but not Android.
    How can I use QtQuickCompiler for Android?
    How can I understand that QtQuickCompiler is working?
    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      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
      2
      • SGaistS SGaist

        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 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?

        SGaistS M 2 Replies Last reply
        1
        • I Ibrahim

          @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?

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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
          1
          • SGaistS SGaist

            @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 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.

            raven-worxR 1 Reply Last reply
            0
            • I Ibrahim

              @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.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on 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
              3
              • raven-worxR raven-worx

                @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 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.

                raven-worxR 1 Reply Last reply
                0
                • I Ibrahim

                  @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.

                  raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on 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
                  2
                  • raven-worxR raven-worx

                    @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 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?

                    raven-worxR 1 Reply Last reply
                    0
                    • I Ibrahim

                      @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?

                      raven-worxR Offline
                      raven-worxR Offline
                      raven-worx
                      Moderators
                      wrote on 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
                      1
                      • raven-worxR raven-worx

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

                        I Offline
                        I Offline
                        Ibrahim
                        wrote on 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

                          @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 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 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