Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Do I really have to deploy 700 files with my QML application?

Do I really have to deploy 700 files with my QML application?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
qmldeploymentdependenciesqtquickwindeployqt
11 Posts 5 Posters 1.5k 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.
  • D Offline
    D Offline
    David_S
    wrote on last edited by David_S
    #1

    I am deploying a relatively small QML application on Windows using Qt 5.12.9. I have deployed QtWidget apps before but this is my first QML app. It is a pretty simple dialog app with a ComboBox, a FileDialog, and a ScrollView. I used the windeployqt tool (with the --qmldir and --release options) to gather the dependencies. The good news is I was able to successfully install and launch the app on a clean computer. The bad news is there are over 700 files in the dependency list generated by windeployqt that I now have to get into an existing installer with other apps. The bulk of these files (651 of them) are under the folder QtQuick. Most of them are .qml and .qmc files.

    My questions are:

    1. Am I doing something wrong that all of these files are being included?
    2. If I have to include them in the deployment, is there a way to move these dependencies to a location other than the directory containing the executable? I tried to use qt.conf but that did not seem to apply to these dependencies.

    Thanks

    1 Reply Last reply
    1
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      use qrc to store qml files which are not needed to be included in deployment.

      D 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        use qrc to store qml files which are not needed to be included in deployment.

        D Offline
        D Offline
        David_S
        wrote on last edited by
        #3

        @JoeCFD I am using qrc to store my QML files. These are files like "ApplicationWindow.qml" "ComboBox.qml" etc. Part of Qt infrastructure; not stuff I wrote. Are you saying there is a way to get all of this packaged in the qrc?

        JoeCFDJ 1 Reply Last reply
        0
        • D David_S

          @JoeCFD I am using qrc to store my QML files. These are files like "ApplicationWindow.qml" "ComboBox.qml" etc. Part of Qt infrastructure; not stuff I wrote. Are you saying there is a way to get all of this packaged in the qrc?

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #4

          @David_S right. Put all of them into one qrc file. Use qml files from qrc. Then they will not be needed for deployment. Same as ui files.

          D raven-worxR 2 Replies Last reply
          0
          • JoeCFDJ JoeCFD

            @David_S right. Put all of them into one qrc file. Use qml files from qrc. Then they will not be needed for deployment. Same as ui files.

            D Offline
            D Offline
            David_S
            wrote on last edited by
            #5

            @JoeCFD Is there a utility to do this? There are literally over 700 files in nested folders.

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

              Hi and welcome to devnet,

              How many different QtQuick modules are you using ?
              Maybe a silly question but did you point qmldir to your application sources ?

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

              D 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi and welcome to devnet,

                How many different QtQuick modules are you using ?
                Maybe a silly question but did you point qmldir to your application sources ?

                D Offline
                D Offline
                David_S
                wrote on last edited by David_S
                #7

                @SGaist Thanks.
                I only have one QML file and it imports
                QtQuick 2.12
                QtQuick.Window 2.12
                QtQuick.Controls 2.12
                QtQuick.Layouts 1.3
                QtQuick.Dialogs 1.0

                The rest is C++.

                I pointed the --qmldir to my source code directory.

                So I take it this is uncommon?

                1 Reply Last reply
                0
                • JoeCFDJ JoeCFD

                  @David_S right. Put all of them into one qrc file. Use qml files from qrc. Then they will not be needed for deployment. Same as ui files.

                  raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on last edited by raven-worx
                  #8

                  @JoeCFD said in Do I really have to deploy 700 files with my QML application?:

                  @David_S right. Put all of them into one qrc file. Use qml files from qrc. Then they will not be needed for deployment. Same as ui files.

                  omg, just dont do it.... how can you give such a terrible advise?!
                  Beside that it wont work anyway afterall ...

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

                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    David_S
                    wrote on last edited by
                    #9

                    I built the "Qt Quick Layouts - Basic Example" in release and then ran windeployqt on it. It pulled in almost 450 files. So I guess this is something we just have to deal with when deploying QML?

                    J.HilkJ 1 Reply Last reply
                    0
                    • D David_S

                      I built the "Qt Quick Layouts - Basic Example" in release and then ran windeployqt on it. It pulled in almost 450 files. So I guess this is something we just have to deal with when deploying QML?

                      J.HilkJ Offline
                      J.HilkJ Offline
                      J.Hilk
                      Moderators
                      wrote on last edited by J.Hilk
                      #10

                      @David_S The thing is, the windepolyqt tool is not perfect.

                      it will parse your project, it sees Oh you're using layouts! Let me get EVERYTHING layout related! when in fact, you only use it for one row layout or something.

                      The tool errors on the side of caution. Same with dlls actually, Oh, you're loading an Image, let me get all the image formats dll's even if you only use pngs!

                      It gets the job done, you hardly ever have to add something from the Qt directory by hand, when you used the tool(correctly)

                      On the up side: Your application folder, from now on, will hardly grow bigger, compared to its current size. As long as you do not add additional modules or such.

                      On the down side: If you actually want to ship a minimalistic folder, you'll have to manually check the content folder and remove unneeded stuff.

                      Make sure to test the application after each removal. The problem with this is also, that a bunch of QML stuff is not loaded/needed on start up and you may only later on, notice this, deep inside the application on page 215 when 20 other conditions are met.

                      So, be cautious!


                      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                      Q: What's that?
                      A: It's blue light.
                      Q: What does it do?
                      A: It turns blue.

                      D 1 Reply Last reply
                      3
                      • J.HilkJ J.Hilk

                        @David_S The thing is, the windepolyqt tool is not perfect.

                        it will parse your project, it sees Oh you're using layouts! Let me get EVERYTHING layout related! when in fact, you only use it for one row layout or something.

                        The tool errors on the side of caution. Same with dlls actually, Oh, you're loading an Image, let me get all the image formats dll's even if you only use pngs!

                        It gets the job done, you hardly ever have to add something from the Qt directory by hand, when you used the tool(correctly)

                        On the up side: Your application folder, from now on, will hardly grow bigger, compared to its current size. As long as you do not add additional modules or such.

                        On the down side: If you actually want to ship a minimalistic folder, you'll have to manually check the content folder and remove unneeded stuff.

                        Make sure to test the application after each removal. The problem with this is also, that a bunch of QML stuff is not loaded/needed on start up and you may only later on, notice this, deep inside the application on page 215 when 20 other conditions are met.

                        So, be cautious!

                        D Offline
                        D Offline
                        David_S
                        wrote on last edited by
                        #11

                        @J-Hilk Thanks for the reply. This adds a bit of complexity to my WIX installer since I don't want to list all 700+ files individually. Do you know if there is anyway to deploy these files in a folder other than where the executable is located? I would like to dump all of the QT dependencies in one folder (which can have subfolders) but I need to be able to "blow away" all of the Qt related dependencies by deleting one directory while being confident that I didn't delete anything but Qt dependencies.

                        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