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. Why does my QML Plugin fails to load when deployed, while it works inside the build dir?
Forum Updated to NodeBB v4.3 + New Features

Why does my QML Plugin fails to load when deployed, while it works inside the build dir?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 407 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.
  • F Offline
    F Offline
    fama_lab3d
    wrote on last edited by
    #1

    Hello,
    I have a QML plugin that is loaded at runtime.
    If I run the app from the build dir, it works flawlessly.
    If I do the same with the deployed application, it fails.

    The build dir is structured like that:

    build\
        MyApp.exe
        GUI\
          Something\
            Other\
              GUI_SOMETHING_OTHERplugin.dll
    

    While the deploy is generated by Qt's deploy script (CMAKE):

    deploy\
      bin\
        <files deployed by qt deploy script>
        MyApp.exe
      qml\
        GUI\
          Something\
            Other\
              GUI_SOMETHING_OTHERplugin.dll
    <other files by qt>
    

    When it starts, the engine import paths are the following:

    • qrc:/
    • <deploy-dir>/bin
    • qrc:/qt-project.org/imports
    • C:/Qt/6.4.2/msvc2019_64/qml
    • <deploy-dir>/qml

    The warning it gives is the following:

    Warning: QQmlApplicationEngine failed to load component
    Warning: qrc:/MillManager/main.qml:7:1: Cannot load library <deploy-dir>\qml\GUI\Something\Other\GUI_SOMETHING_OTHERplugin.dll: The specified module could not be found.
    

    It's strange, because the .dll exists! And it's in that path!

    dheerendraD 1 Reply Last reply
    0
    • F fama_lab3d

      Hello,
      I have a QML plugin that is loaded at runtime.
      If I run the app from the build dir, it works flawlessly.
      If I do the same with the deployed application, it fails.

      The build dir is structured like that:

      build\
          MyApp.exe
          GUI\
            Something\
              Other\
                GUI_SOMETHING_OTHERplugin.dll
      

      While the deploy is generated by Qt's deploy script (CMAKE):

      deploy\
        bin\
          <files deployed by qt deploy script>
          MyApp.exe
        qml\
          GUI\
            Something\
              Other\
                GUI_SOMETHING_OTHERplugin.dll
      <other files by qt>
      

      When it starts, the engine import paths are the following:

      • qrc:/
      • <deploy-dir>/bin
      • qrc:/qt-project.org/imports
      • C:/Qt/6.4.2/msvc2019_64/qml
      • <deploy-dir>/qml

      The warning it gives is the following:

      Warning: QQmlApplicationEngine failed to load component
      Warning: qrc:/MillManager/main.qml:7:1: Cannot load library <deploy-dir>\qml\GUI\Something\Other\GUI_SOMETHING_OTHERplugin.dll: The specified module could not be found.
      

      It's strange, because the .dll exists! And it's in that path!

      dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      May be your library depends on some other library. This may be missing in path.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      F 1 Reply Last reply
      1
      • dheerendraD dheerendra

        May be your library depends on some other library. This may be missing in path.

        F Offline
        F Offline
        fama_lab3d
        wrote on last edited by
        #3

        @dheerendra it's actually just 1 .qml file built with qt_add_qml_module, nothing else.

        dheerendraD 1 Reply Last reply
        0
        • F fama_lab3d

          @dheerendra it's actually just 1 .qml file built with qt_add_qml_module, nothing else.

          dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          what is the import statement in main.qml ?

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          F 1 Reply Last reply
          1
          • dheerendraD dheerendra

            what is the import statement in main.qml ?

            F Offline
            F Offline
            fama_lab3d
            wrote on last edited by
            #5

            @dheerendra I'm generating a QML file at runtime and load it with a Loader:

            ListView {
              delegate: Loader {
                sourceComponent: Qt.createComponent(model.qmlFile)
              }
            }
            

            The generated file is very simple:

            import GUI.Something.Other
            
            GUI {
            }
            
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved