Qt Forum

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

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

    Installation and Deployment
    qml deployment dependencies qtquick windeployqt
    5
    11
    567
    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.
    • D
      David_S last edited by David_S

      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 Reply Quote 1
      • JoeCFD
        JoeCFD last edited by

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

        D 1 Reply Last reply Reply Quote 0
        • D
          David_S @JoeCFD last edited by

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

          JoeCFD 1 Reply Last reply Reply Quote 0
          • JoeCFD
            JoeCFD @David_S last edited by 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 raven-worx 2 Replies Last reply Reply Quote 0
            • D
              David_S @JoeCFD last edited by

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

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • D
                  David_S @SGaist last edited by David_S

                  @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 Reply Quote 0
                  • raven-worx
                    raven-worx Moderators @JoeCFD last edited by raven-worx

                    @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 Reply Quote 1
                    • D
                      David_S last edited by

                      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.Hilk 1 Reply Last reply Reply Quote 0
                      • J.Hilk
                        J.Hilk Moderators @David_S last edited by 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!

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

                        Qt Needs YOUR vote: https://bugreports.qt.io/browse/QTQAINFRA-4121


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

                        D 1 Reply Last reply Reply Quote 3
                        • D
                          David_S @J.Hilk last edited by

                          @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 Reply Quote 0
                          • First post
                            Last post