[Interest] (Q)Plugins and QML/Quick

Ulf Hermann ulf.hermann at qt.io
Wed Sep 15 08:06:48 CEST 2021

> But my goal is to not know about the types beforehand at all. It's 
> basically the "copy the dll to the application folder and it'll 
> magically show up as an option" pattern. The goal is to provide an 
> extensibility framework, like eclipse, or web browser addons. Not just 
> using a type defined elsewhere.

There is Loader [1]. You can define some convention on where the entry 
point to a module is to be found, and construct a URL for Loader out of 
that. Then you can scan the relevant QML import paths and record the 
available modules. The result can be presented as a menu.

Mind that loading a QML file directly from the host file system prevents 
you from using the pre-compiled byte code in the plugin. Therefore, the 
entry points should probably only do a named import of their module and 
instantiate some other type made available that way.

[1] https://doc.qt.io/qt-5/qml-qtquick-loader.html

More information about the Interest mailing list