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. Loading QML from a plugin's QRC

Loading QML from a plugin's QRC

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 669 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.
  • V Offline
    V Offline
    VRHans
    wrote on last edited by
    #1

    I have a Qml application that hosts Qml components that are contained in plugins (dll/so/dynlib) which contain QML resources.

    I want to be able to ask the plugin for the QUrl to the qml code it would like the application to display and I wanted to know how will my app know to resolve the Url in the plugin rather than its own resources built into the application.

    For example, if my application has a main.qml and the person who wrote the plugin has a main.qml built into their plugin - how can I point the QUrl towards the plugin's resources rather than the hosting application's?

    E.g.

    component.loadUrl( QUrl( QStringLiteral( "qrc:/MyComponent.qml" ) ) );
    

    How would my application code indicate to the ::loadUrl() method that it should look in the plugin to resolve that Url?

    Does everything get glommed together into one big resource table and I need to introduce a naming schema such as "qrc:/myplugin.MyComponent.qml"?

    Worst case I presume the plugin could just read the qml like a string and pass that along, but that makes organizing the qml code on the plugin side more complicated.

    1 Reply Last reply
    0
    • M michael_su referenced this topic on

    • Login

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