Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Why Qt qml files are needed in app deploy when using Qt Quick Compiler
Forum Updated to NodeBB v4.3 + New Features

Why Qt qml files are needed in app deploy when using Qt Quick Compiler

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 4 Posters 1.1k Views 1 Watching
  • 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 Offline
    N Offline
    nejatafshar
    wrote on last edited by
    #1

    When using Qt Quick Compiler by setting flag CONFIG += qtquickcompiler, after deploying using windeployqt, all qml files of Qt Quick modules are copied to deploy directory in sub directories like QtQuick and so on. If I delete some of there qml files, qml engine gives lots of errors and many components don't get loaded. Why are the source code of these modules required when I am using Qt Quick Compiler?

    C JKSHJ 2 Replies Last reply
    0
    • N nejatafshar

      When using Qt Quick Compiler by setting flag CONFIG += qtquickcompiler, after deploying using windeployqt, all qml files of Qt Quick modules are copied to deploy directory in sub directories like QtQuick and so on. If I delete some of there qml files, qml engine gives lots of errors and many components don't get loaded. Why are the source code of these modules required when I am using Qt Quick Compiler?

      C Offline
      C Offline
      closx
      wrote on last edited by
      #2

      @nejatafshar Maybe because Qt Quick Compiler needs them when compiling :D You are creating kind of a dependency by deploying an application.

      bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
      tag me (like @closx) if you are answering to me, so I can notice :D

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nejatafshar
        wrote on last edited by
        #3

        So what's the point of using Qt Quick Compiler? If Qt Quick modules are not compiled then there is no performance gain in app startup and other benefits as I am heavily using Qt Quick modules in my project.

        C KroMignonK 2 Replies Last reply
        0
        • N nejatafshar

          So what's the point of using Qt Quick Compiler? If Qt Quick modules are not compiled then there is no performance gain in app startup and other benefits as I am heavily using Qt Quick modules in my project.

          C Offline
          C Offline
          closx
          wrote on last edited by
          #4

          @nejatafshar You cannot make an omelette without eggs :D It is a dependency dude. You can imagine that as qt tells the compiler to compile some code into an app, and compiler looks for the appropriate modules etc.

          bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
          tag me (like @closx) if you are answering to me, so I can notice :D

          1 Reply Last reply
          0
          • N nejatafshar

            So what's the point of using Qt Quick Compiler? If Qt Quick modules are not compiled then there is no performance gain in app startup and other benefits as I am heavily using Qt Quick modules in my project.

            KroMignonK Offline
            KroMignonK Offline
            KroMignon
            wrote on last edited by
            #5

            @nejatafshar if you don't want to have distribut qml files, you have to add them in a resources file (QRC) => for more details take a look at https://doc.qt.io/qt-5/qtquick-deployment.html#ahead-of-time-compilation

            It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

            1 Reply Last reply
            0
            • N Offline
              N Offline
              nejatafshar
              wrote on last edited by
              #6

              @KroMignon My problem is not with my qml files. I have already added them to resource file. The problem is with qml files of Qt Quick modules. Why should I ship them while using Qt Quick Compiler? It's wise to have .qmlc files of Qt Quick modules in deploy but why it's necessary to also have many qml files?

              KroMignonK 1 Reply Last reply
              0
              • N nejatafshar

                When using Qt Quick Compiler by setting flag CONFIG += qtquickcompiler, after deploying using windeployqt, all qml files of Qt Quick modules are copied to deploy directory in sub directories like QtQuick and so on. If I delete some of there qml files, qml engine gives lots of errors and many components don't get loaded. Why are the source code of these modules required when I am using Qt Quick Compiler?

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @nejatafshar said in Why Qt qml files are needed in app deploy when using Qt Quick Compiler:

                Why are the source code of these modules required when I am using Qt Quick Compiler?

                Because the Qt Quick Compiler compiles your project's QML code. It doesn't compile Qt's built-in QML code.

                If Qt Quick modules are not compiled then there is no performance gain in app startup and other benefits as I am heavily using Qt Quick modules in my project.

                Have you benchmarked to check to see if there's a performance gain?

                Anyway, the Qt Quick Compiler is only one of many ways to speed up startup: https://blog.qt.io/blog/2019/01/11/qt-5-12-lts-road-faster-qml-application-startup/

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                1
                • N nejatafshar

                  @KroMignon My problem is not with my qml files. I have already added them to resource file. The problem is with qml files of Qt Quick modules. Why should I ship them while using Qt Quick Compiler? It's wise to have .qmlc files of Qt Quick modules in deploy but why it's necessary to also have many qml files?

                  KroMignonK Offline
                  KroMignonK Offline
                  KroMignon
                  wrote on last edited by
                  #8

                  @nejatafshar said in Why Qt qml files are needed in app deploy when using Qt Quick Compiler:

                  The problem is with qml files of Qt Quick modules.

                  Hmm, this is something I can not answer... I think you have to ask this question to Qt developers mailing list to got an answer ==> https://lists.qt-project.org/listinfo/development

                  It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    nejatafshar
                    wrote on last edited by
                    #9

                    @JKSH Thanks for the hint. So I should compile Qt with Qt Quick Compiler option set? But I wonder why some Qt's QML code are compiled in .qmlc files and I only need them for deploy and some other are not compiled and I need .qml files.

                    JKSHJ 1 Reply Last reply
                    0
                    • N nejatafshar

                      @JKSH Thanks for the hint. So I should compile Qt with Qt Quick Compiler option set? But I wonder why some Qt's QML code are compiled in .qmlc files and I only need them for deploy and some other are not compiled and I need .qml files.

                      JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by
                      #10

                      You're welcome.

                      @nejatafshar said in Why Qt qml files are needed in app deploy when using Qt Quick Compiler:

                      So I should compile Qt with Qt Quick Compiler option set?

                      I'm not sure what will happen if you compile Qt with that option.

                      But I wonder why some Qt's QML code are compiled in .qmlc files and I only need them for deploy and some other are not compiled and I need .qml files.

                      That's a good question. I would've expected all of Qt's built-in QML code to be pre-compiled into .qmlc... Maybe the devs forgot some of them? You could ask at the Development mailing list. You must subscribe before posting.

                      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                      1 Reply Last reply
                      1

                      • Login

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