Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127405

qt_generate_deploy_qml_app_script does not deploy dependencies of a QML Module thats not in a subfolder

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.7.2
    • None
    • CMake 3.27.9
      MSVC 14.39
    • Windows

    Description

      Hi,

       

      I noticed that the script generated by qt_generate_deploy_qml_app_script does not deploy all dependences when the application links to a static QML Module target that is not a child of the application directory.

      Given i have the following project structure:

      - app/
         CMakeLists:
                  qt_add_executable(A)
                  qt_add_qml_module(A)
                  target_link_libraries(A PRIVATE B Bplugin)
      - module/
         CMakeLists:
                 qt_add_library(B STATIC)
                 qt_add_qml_module(B)
      

       

       

      We can build and run the project like usual inside QtCreator. In my case in particular, only library B has imported QtQuick.Dialogs. When I deploy it:

       

      ..\test_qmlmodule_deploy> cmake --install build\Desktop_Qt_6_7_2_MSVC2019_64bit-Debug\
      

      the files for QtQuick.Dialogs are missing:

      ..\test_qmlmodule_deploy> install\bin\test_qmlmodule_deploy.exe
      QML debugging is enabled. Only use this in a safe environment.
      QQmlApplicationEngine failed to load component
      qrc:/qt/qml/test_qmlmodule_deploy/Main.qml:9:5: Type TestComponent unavailable
      qrc:/qt/qml/mymodule/TestComponent.qml:2:1: module "QtQuick.Dialogs" is not installed
      

      If I import QtQuick.Dialogs in the main application QML, i don't have this issue. So it seems that the qmlimportscanner does not detect the imports from dependent QML libraries. Additionally, if I put the module in a subdirectory instead of side-by-side it is also working correctly.

       

      As far as i read the documentation and guides there is also no script or addional command that should be specified when defining a QML module that is neccessary to deploy successfully.

       

      I only tested it on windows for now, but I will test it on Linux aswell.

       

      Attached is a simple project that demonstates the situation.

       

      Thank you and Best Regards

       

      Michael Wechner

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            mwechner Michael Wechner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes