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. Question About resource reference qml file from plugin dll
Qt 6.11 is out! See what's new in the release blog

Question About resource reference qml file from plugin dll

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 1.1k 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.
  • M Offline
    M Offline
    michael_su
    wrote on last edited by
    #1
    1. I build one qml application, and put some qml into one plugin;
    2. using qt_add_qml_module, build qml in plugin into one module;
    3. plugin's build type is shared lib, in windows, build into dll file;

    I want to know, how to using "qrc:/qt/qml/ModuleName/qml_dir/xxx.qml" to reference qml file buit in plugin dll?

    thank you.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      michael_su
      wrote on last edited by
      #2

      same question here: https://forum.qt.io/topic/65367/loading-qml-from-a-plugin-s-qrc
      but no answer.

      I open plugin dll file using hex editor, I have found qml file's content is compiled into it.
      now,
      if I using module's component in main application's qml file, it's ok.
      if I using engine.loadFromModule("ModuleName", "QmlFileName"), is ok.
      but I want to use "ModuleName"/"QmlFileName" as QUrl, because I must keep compatible with old version.
      so, could any body help me?
      I don't want to use rcc to build rcc file, and register in main application, it's confused.
      and for compatible, I cannot statically link plugin with main application.
      thanks again.

      1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        Is this issue resolved ? Can you show me the call you are trying to make & which is failing ? How are you trying to access & what is failing ? Give me sample on this.

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

        M 1 Reply Last reply
        0
        • dheerendraD dheerendra

          Is this issue resolved ? Can you show me the call you are trying to make & which is failing ? How are you trying to access & what is failing ? Give me sample on this.

          M Offline
          M Offline
          michael_su
          wrote on last edited by
          #4

          @dheerendra
          thank you for your replying.

          I write an demo to show this, pls help me

          https://github.com/blazewater-gmail/DemoPlugin.git
          

          an Extra module as independent plugin, will build to dynamic lib(dll), and qml file (Main.qml) will be embeded into ExtraPlugin.dll

          in main application's main.cpp, import path (../plugins/)

          but cannot using QUrl to reference qrc:/qt/qml/Extra/Main.qml;

          I tried, loadModule(from QT6.5) is OK

          but I must keep compatiblility with QT6.3, so I cannot using loadModule("Extra", "Main");

          likely in main application, cannot read url path from dll file?

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #5

            @michael_su Did this issue resolved ?.

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

            1 Reply Last reply
            0
            • dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Qt Champions 2022
              wrote on last edited by
              #6

              @michael_su Finally solved this. Let me know if you need help.

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

              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