Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How to deploy QML Application with QtCharts module by using windeployqt
Qt 6.11 is out! See what's new in the release blog

How to deploy QML Application with QtCharts module by using windeployqt

Scheduled Pinned Locked Moved Unsolved Qt 6
9 Posts 7 Posters 4.0k 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.
  • L Offline
    L Offline
    LCVitality
    wrote on last edited by
    #1

    I wanna package my application by using windeployqt, however, the charts components didnt show up.
    I already tried to copy QtCharts folder and Qt6Charts.dll manully like what I did with Qt5, but it didnt work.
    The Qt version is 6.2.0, anybody can help?

    FeRDNYCF 1 Reply Last reply
    0
    • L LCVitality

      I wanna package my application by using windeployqt, however, the charts components didnt show up.
      I already tried to copy QtCharts folder and Qt6Charts.dll manully like what I did with Qt5, but it didnt work.
      The Qt version is 6.2.0, anybody can help?

      FeRDNYCF Offline
      FeRDNYCF Offline
      FeRDNYC
      wrote on last edited by
      #2

      @LCVitality QtCharts is a Qt add-on, and as such doesn't appear to be directly supported by windeployqt. (I'm basing that on the fact that it isn't listed as an "available library" by winqtdeploy --help, even when it's installed in the Qt build being deployed:

      After installing Qt 6.2.1, both MSVC and MinGW, using the online installer...

      C:\> cd Qt\6.2.1\msvc2019_64\bin
      C:\Qt\6.2.1\msvc2019_64\bin>set PATH=%cd%:%PATH%
      C:\Qt\6.2.1\msvc2019_64\bin>windeployqt.exe --help
      # [...]
      Qt libraries can be added by passing their name (-xml) or removed by passing
      the name prepended by --no- (--no-xml). Available libraries:
      bluetooth concurrent core declarative designer designercomponents gamepad gui
      qthelp multimedia multimediawidgets multimediaquick network nfc opengl
      openglwidgets positioning printsupport qml qmltooling quick quickparticles
      quickwidgets script scripttools sensors serialport sql svg svgwidgets test
      websockets widgets winextras xml webenginecore webengine webenginewidgets 3dcore
      3drenderer 3dquick 3dquickrenderer 3dinput 3danimation 3dextras geoservices
      webchannel texttospeech serialbus webview shadertools
      

      Meanwhile, in a MinGW64 bash shell...

      $ cd /C/Qt/6.2.1/mingw81_64/bin
      $ export PATH=$(pwd):$PATH
      $ ./windeployqt.exe --help
      # [...]
      Qt libraries can be added by passing their name (-xml) or removed by passing
      the name prepended by --no- (--no-xml). Available libraries:
      bluetooth concurrent core declarative designer designercomponents gamepad gui
      qthelp multimedia multimediawidgets multimediaquick network nfc opengl
      openglwidgets positioning printsupport qml qmltooling quick quickparticles
      quickwidgets script scripttools sensors serialport sql svg svgwidgets test
      websockets widgets winextras xml webenginecore webengine webenginewidgets 3dcore
      3drenderer 3dquick 3dquickrenderer 3dinput 3danimation 3dextras geoservices
      webchannel texttospeech serialbus webview shadertools
      

      (...I have no idea why webengine, webenginecore, and webenginewidgets are listed there — it would've been a major coup if they were available in MinGW Qt6, but I triple-checked and they are, in fact, not. Which must mean that the windeployqt library list is hardcoded, not actually generated to reflect the installed components as I'd hoped/assumed. Laaaaame.)

      Still, no Charts listed on its disappointingly-hardcoded list of supported libraries.

      L 1 Reply Last reply
      0
      • FeRDNYCF FeRDNYC

        @LCVitality QtCharts is a Qt add-on, and as such doesn't appear to be directly supported by windeployqt. (I'm basing that on the fact that it isn't listed as an "available library" by winqtdeploy --help, even when it's installed in the Qt build being deployed:

        After installing Qt 6.2.1, both MSVC and MinGW, using the online installer...

        C:\> cd Qt\6.2.1\msvc2019_64\bin
        C:\Qt\6.2.1\msvc2019_64\bin>set PATH=%cd%:%PATH%
        C:\Qt\6.2.1\msvc2019_64\bin>windeployqt.exe --help
        # [...]
        Qt libraries can be added by passing their name (-xml) or removed by passing
        the name prepended by --no- (--no-xml). Available libraries:
        bluetooth concurrent core declarative designer designercomponents gamepad gui
        qthelp multimedia multimediawidgets multimediaquick network nfc opengl
        openglwidgets positioning printsupport qml qmltooling quick quickparticles
        quickwidgets script scripttools sensors serialport sql svg svgwidgets test
        websockets widgets winextras xml webenginecore webengine webenginewidgets 3dcore
        3drenderer 3dquick 3dquickrenderer 3dinput 3danimation 3dextras geoservices
        webchannel texttospeech serialbus webview shadertools
        

        Meanwhile, in a MinGW64 bash shell...

        $ cd /C/Qt/6.2.1/mingw81_64/bin
        $ export PATH=$(pwd):$PATH
        $ ./windeployqt.exe --help
        # [...]
        Qt libraries can be added by passing their name (-xml) or removed by passing
        the name prepended by --no- (--no-xml). Available libraries:
        bluetooth concurrent core declarative designer designercomponents gamepad gui
        qthelp multimedia multimediawidgets multimediaquick network nfc opengl
        openglwidgets positioning printsupport qml qmltooling quick quickparticles
        quickwidgets script scripttools sensors serialport sql svg svgwidgets test
        websockets widgets winextras xml webenginecore webengine webenginewidgets 3dcore
        3drenderer 3dquick 3dquickrenderer 3dinput 3danimation 3dextras geoservices
        webchannel texttospeech serialbus webview shadertools
        

        (...I have no idea why webengine, webenginecore, and webenginewidgets are listed there — it would've been a major coup if they were available in MinGW Qt6, but I triple-checked and they are, in fact, not. Which must mean that the windeployqt library list is hardcoded, not actually generated to reflect the installed components as I'd hoped/assumed. Laaaaame.)

        Still, no Charts listed on its disappointingly-hardcoded list of supported libraries.

        L Offline
        L Offline
        LCVitality
        wrote on last edited by
        #3

        @FeRDNYC Thanks for reply.
        I understand QtCharts is not supported by windeployqt.
        In Qt5, after

        windeployqt path/to/executable.exe --qmldir path/to/qml
        

        I need to copy QtCharts folder and Qt5Charts.dll to the directory of the executable.exe, then run the executable, QtCharts works well.
        I did the same thing in Qt6, but it didnt work.
        I wanna know is there any approch works for Qt6?
        Thanks again.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          anitsch
          wrote on last edited by
          #4

          I have the same problem...
          Were you able to resolve the problem?
          I'm on Qt 6.2.4, QtCharts is installed with the MaintenanceTool, but

          1. windeployqt.exe does not recognise QtCharts as a dependency
          2. It can't be added manually with -qtcharts or - charts
          3. Manually copying the .dll and the Folder from the qml folder does not work
          1 Reply Last reply
          0
          • X Offline
            X Offline
            xyzwei
            wrote on last edited by
            #5

            I solved it,but I am not sure if Qt engineer upgraded windeployqt.exe.
            I'm on Qt 6.3.1,msvc2019_64.
            The windeployqt.exe can create QtCharts libraries directly (QtCharts folder ,Qt6Charts.dll and Qt6ChartsQml.dll).
            And copy folder and dll still doesn't work.

            I guess, many people use windeployqt.exe incorrectly.
            If you can run your qml program with Qtcharts module in VS or Qcreater, it could create library by windeployqt.exe.

            windeployqt path/to/executable.exe --qmldir path/to/qml
            

            The qmldir path should be your progarm‘s qml’s folder instead of qt‘s or qtcreator’s folder.
            My folder include main.qml, such as

            windeployqt D:\C++\test\x64\Release\test.exe --qmldir D:\C++\test\test\
            

            instead of

            windeployqt D:\C++\test\x64\Release\test.exe --qmldir D:Qt\Qt6.3.1\msvc2019_64\qml
            
            D Q 2 Replies Last reply
            1
            • X xyzwei

              I solved it,but I am not sure if Qt engineer upgraded windeployqt.exe.
              I'm on Qt 6.3.1,msvc2019_64.
              The windeployqt.exe can create QtCharts libraries directly (QtCharts folder ,Qt6Charts.dll and Qt6ChartsQml.dll).
              And copy folder and dll still doesn't work.

              I guess, many people use windeployqt.exe incorrectly.
              If you can run your qml program with Qtcharts module in VS or Qcreater, it could create library by windeployqt.exe.

              windeployqt path/to/executable.exe --qmldir path/to/qml
              

              The qmldir path should be your progarm‘s qml’s folder instead of qt‘s or qtcreator’s folder.
              My folder include main.qml, such as

              windeployqt D:\C++\test\x64\Release\test.exe --qmldir D:\C++\test\test\
              

              instead of

              windeployqt D:\C++\test\x64\Release\test.exe --qmldir D:Qt\Qt6.3.1\msvc2019_64\qml
              
              D Offline
              D Offline
              Developer123
              wrote on last edited by
              #6

              @xyzwei Wow, indeed this seems to work.

              It's amazing how poorly documented everything in QT is .. even the forums give mostly wrong/partial answers and you need to waste hours just to find the ones that work.

              By the way, the final command that worked for me, in case anyone needs, is:

              windeployqt --release --qmldir C:\path\to\project executable.exe
              
              V 1 Reply Last reply
              0
              • X xyzwei

                I solved it,but I am not sure if Qt engineer upgraded windeployqt.exe.
                I'm on Qt 6.3.1,msvc2019_64.
                The windeployqt.exe can create QtCharts libraries directly (QtCharts folder ,Qt6Charts.dll and Qt6ChartsQml.dll).
                And copy folder and dll still doesn't work.

                I guess, many people use windeployqt.exe incorrectly.
                If you can run your qml program with Qtcharts module in VS or Qcreater, it could create library by windeployqt.exe.

                windeployqt path/to/executable.exe --qmldir path/to/qml
                

                The qmldir path should be your progarm‘s qml’s folder instead of qt‘s or qtcreator’s folder.
                My folder include main.qml, such as

                windeployqt D:\C++\test\x64\Release\test.exe --qmldir D:\C++\test\test\
                

                instead of

                windeployqt D:\C++\test\x64\Release\test.exe --qmldir D:Qt\Qt6.3.1\msvc2019_64\qml
                
                Q Offline
                Q Offline
                QSaker
                wrote on last edited by
                #7

                @xyzwei Nice!!!!!!!!!!!!!!!!

                1 Reply Last reply
                0
                • D Developer123

                  @xyzwei Wow, indeed this seems to work.

                  It's amazing how poorly documented everything in QT is .. even the forums give mostly wrong/partial answers and you need to waste hours just to find the ones that work.

                  By the way, the final command that worked for me, in case anyone needs, is:

                  windeployqt --release --qmldir C:\path\to\project executable.exe
                  
                  V Offline
                  V Offline
                  Vlogo11
                  wrote on last edited by
                  #8

                  @Developer123 hi! im using qt with a .pro file and mingw. i dont have a qml file. what can i do? i have the same problem

                  FeRDNYCF 1 Reply Last reply
                  0
                  • V Vlogo11

                    @Developer123 hi! im using qt with a .pro file and mingw. i dont have a qml file. what can i do? i have the same problem

                    FeRDNYCF Offline
                    FeRDNYCF Offline
                    FeRDNYC
                    wrote on last edited by
                    #9

                    @Vlogo11 What do you mean you "have the same problem"? What problem do you have? Have you even built your application yet?

                    (Because, the fact that you're using a .pro file should be irrelevant, windeployqt is run on the .exe file that results from building your application. Whether you're using CMake or qmake, you need to generate a build system and compile your application before you can do anything with windeployqt.)

                    Once you have an application executable, just run windeployqt myapplication.exe on the compiled program. If you don't have any QML then you don't even need to worry about --qmldir at all.

                    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