Important: Please read the Qt Code of Conduct -

Using QML components from resources in main app in QML components from shared libraries

  • Hi,

    My application loads shared libraries at runtime using QPluginLoader.
    These libraries contain QML files as resources, which are added to the rootObject of a QQuickView when loaded.

    Everything works fine, but since many of these plugins use identical custom QML components, I would like to use those which exist as resources in the main application.

    So suppose my main application has the following QML resources:


    I would like to have a QML file as a resource in a plugin that uses this component.

    I'm looking at using QQmlExtensionPlugin, but I haven't figured that out completely.

    Is this the only way or is there a simpler, more direct method?


Log in to reply