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. Deployment of QML/C++ app on windows
QtWS25 Last Chance

Deployment of QML/C++ app on windows

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qml c++qml windowswindeployqt
7 Posts 2 Posters 2.2k 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.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #1

    I am used to develop C++ applications on windows and started some time back to have also qml apps on Android.

    To one of my C++ apps a QML interface was added and I can run it without problems on Android. Creation and deployment is done through Qt creator. The combined app can be compiled also on windows and it runs without issues.

    A while ago I have noted that apparently my MinGW 64 versions have issues after a while. Multiple reinstalling of Qt 64 bit version did not help at all. Today I had the same issue starting. My application started to complain about a QML import not possible when starting through creator.

    qrc:/EdgeGui.qml:8:1: module "QtQuick.Controls" is not installed
         import QtQuick.Controls 2.15
    

    Last thing done before was adding all required dlls to the folder with my exes. When removing the dlls fromfolder I could start my app through creator again, which solved the mystery I experienced for a while.

    Therefore something must be missing when I am copying all dlls to the exe folder. I am used to do it manually.

    Finally I convinced myself to use windeployqt. However, also when using windeployqt and I start the app directly from the folder I will receive the error message again.

    What am I missing?

    Vote the answer(s) that helped you to solve your issue(s)

    J.HilkJ 1 Reply Last reply
    0
    • K koahnig

      I am used to develop C++ applications on windows and started some time back to have also qml apps on Android.

      To one of my C++ apps a QML interface was added and I can run it without problems on Android. Creation and deployment is done through Qt creator. The combined app can be compiled also on windows and it runs without issues.

      A while ago I have noted that apparently my MinGW 64 versions have issues after a while. Multiple reinstalling of Qt 64 bit version did not help at all. Today I had the same issue starting. My application started to complain about a QML import not possible when starting through creator.

      qrc:/EdgeGui.qml:8:1: module "QtQuick.Controls" is not installed
           import QtQuick.Controls 2.15
      

      Last thing done before was adding all required dlls to the folder with my exes. When removing the dlls fromfolder I could start my app through creator again, which solved the mystery I experienced for a while.

      Therefore something must be missing when I am copying all dlls to the exe folder. I am used to do it manually.

      Finally I convinced myself to use windeployqt. However, also when using windeployqt and I start the app directly from the folder I will receive the error message again.

      What am I missing?

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

      Hi @koahnig

      since you now tried to use windeployqt did you give it the correct qmldir parameter ? It is usually the main reason for deployment issues of QML applications

      Are those QML import complains actual errors ? as in the program does not launch correctly or closes abruptly ? Sometimes I have "missing" includes and imports that are pure QtCreator issues and compiles and runs everything just fine.


      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.

      K 1 Reply Last reply
      1
      • J.HilkJ J.Hilk

        Hi @koahnig

        since you now tried to use windeployqt did you give it the correct qmldir parameter ? It is usually the main reason for deployment issues of QML applications

        Are those QML import complains actual errors ? as in the program does not launch correctly or closes abruptly ? Sometimes I have "missing" includes and imports that are pure QtCreator issues and compiles and runs everything just fine.

        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        Hi @J-Hilk

        No, I did not use the qmldir parameter. Which is the correct qml folder?

        windeployqt has been used only with the app name as parameter respectively with the actual folder name where app resides. windeployqt was started on command line with its full location folder name in use.

        One dll was still missing after windeployqt run which has been added manually (QtSerialPort).

        The app can start but the qml window of app is considerably smaller and empty. The error message is displayed in command window. The app is apparently stuck in an endless loop during startup.

        Vote the answer(s) that helped you to solve your issue(s)

        J.HilkJ 1 Reply Last reply
        0
        • K koahnig

          Hi @J-Hilk

          No, I did not use the qmldir parameter. Which is the correct qml folder?

          windeployqt has been used only with the app name as parameter respectively with the actual folder name where app resides. windeployqt was started on command line with its full location folder name in use.

          One dll was still missing after windeployqt run which has been added manually (QtSerialPort).

          The app can start but the qml window of app is considerably smaller and empty. The error message is displayed in command window. The app is apparently stuck in an endless loop during startup.

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

          @koahnig you give it the path to the folder of your very own top most *.qml file (usually the folder that contains main.qml)

          The tool will than parse all qml files in that folder + all subfolders and check all imports and copy the related files and dll's

          If you do not give the tool that path (or the correct one) you will indeed end up with a white scene, as nothing could be loaded :D


          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.

          K 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @koahnig you give it the path to the folder of your very own top most *.qml file (usually the folder that contains main.qml)

            The tool will than parse all qml files in that folder + all subfolders and check all imports and copy the related files and dll's

            If you do not give the tool that path (or the correct one) you will indeed end up with a white scene, as nothing could be loaded :D

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @J-Hilk

            Interesting!

            The help text says:

             --qmldir <directory>        Scan for QML-imports starting from directory.
            

            I have not imagined your interpretation. With trial and error the mingw folder (basically where also the bin folder of windeployqt is) has been used without any change of the situation. Next trial was directly the qml folder in that folder. The output of windeployqt was very different from runs before. Moreover it solved the issue. I could start the application from command prompt without the error message. BTW the actual qml folder of my app is not nearby at all. I assume that there is no way windployqt could know.

            Will continue with some tests if the ifw can be used now successfully.

            Vote the answer(s) that helped you to solve your issue(s)

            J.HilkJ 1 Reply Last reply
            0
            • K koahnig

              @J-Hilk

              Interesting!

              The help text says:

               --qmldir <directory>        Scan for QML-imports starting from directory.
              

              I have not imagined your interpretation. With trial and error the mingw folder (basically where also the bin folder of windeployqt is) has been used without any change of the situation. Next trial was directly the qml folder in that folder. The output of windeployqt was very different from runs before. Moreover it solved the issue. I could start the application from command prompt without the error message. BTW the actual qml folder of my app is not nearby at all. I assume that there is no way windployqt could know.

              Will continue with some tests if the ifw can be used now successfully.

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

              @koahnig great that it works now!

              the deployment tool generally fetches to much, according to the "better save then sorry" principle

              if you point qmldir to the Qt-Framework installation, and the qml files there, the tool will quite literally fetch everything qml related :D

              I highly recommend the path to your own QML-File-Folder


              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.

              K 1 Reply Last reply
              1
              • J.HilkJ J.Hilk

                @koahnig great that it works now!

                the deployment tool generally fetches to much, according to the "better save then sorry" principle

                if you point qmldir to the Qt-Framework installation, and the qml files there, the tool will quite literally fetch everything qml related :D

                I highly recommend the path to your own QML-File-Folder

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                @J-Hilk

                I got it to work with ifw as well. However, the option --plugindir apparently does not work correctly. The plugins were stored in the folder of the exe.

                However, also the installation using ifw was finally successful.

                Vote the answer(s) that helped you to solve your issue(s)

                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