0

I am trying to deploy an application using the windeployqt --qmldir method. When the command is run from within the folder that contains the executable, all the dependencies are copied and everything appears to go well. Except, when I click on the application file to run the it on a system that does not have Qt installed, it simply will not start. I get the busy mouse pointer for a few seconds and then nothing. No errors or anything. It does start fine on the machine with Qt installed but not on the other. I tried deploying a few of my other projects using the same method and they all worked just fine. Then it occurred to me that it might be the multiple qmldir "modules" that I'm using. So I took a project that previously deployed just fine, added a qmldir module to it and deployed it again, aaaand nothing. Same "not starting" problem. How do I use the windeployqt tool with projects that have multiple qmldir modules? What am I missing? I am using a number of qmldir files, all of which exist within a single qrc resource file that houses all of my application's qml. Here is my project structure and the commands I tried:

-Top_Level_Project_Dir
     -GUI_Construction
          -fonts
          -images
          -javascript
          -qml
               -Construction_QML
                    -QML_Elements_Directory_1
                         - a bunch of qml files, some in their own folders
                         - qmldir
                    -QML_Elements_Directory_2
                         - a bunch of qml files, some in their own folders
                         - qmldir
                    -Singletons
                         - Globals
                              - qmldir
                         - Menus
                              - qmldir
          -qml.qrc
    - GUI Tests

The windeployqt commands that I have tried are:

windeployqt --qmldir C:\QtProjects\Top_Level_Project_Dir\GUI_Construction\qml <location of exe>

That does not work. Also tried:

windeployqt --qmldir C:\QT\5.15.1\msvc2019_64\qml <location of exe>

This made the deploy directory quite large because it copied everything but it still didn't work. Then I tried plugging in the import paths (specified in the main.cpp file using engine.addImportPath()) after the --qmlimport option:

windeployqt --qmldir C:\QtProjects\Top_Level_Project_Dir\GUI_Construction\qml --qmlimport C:\QtProjects\Top_Level_Project_Dir\GUI_Construction\qml\Construction_QML (same for each qmldir) <location of exe>

This also did not work. It just copied all my qml files to the deploy directory, which is something I want to avoid anyway.

comp1201
  • 407
  • 3
  • 13
  • 1
    It might help if you listed your project's structure (using e.g. `tree`) and provided the exact command you're using. You should also run your app after opening [DebugView](https://learn.microsoft.com/en-us/sysinternals/downloads/debugview) to find out what the exact error is and then edit it into your question. – Mitch Jul 29 '21 at 15:21
  • @Mitch Just added my project directory structure along with some of the windeployqt commands that I tried. Still haven't figured this one out. I'll check out DebugView. – comp1201 Jul 29 '21 at 16:54

0 Answers0