Skip to content

Add infrastructure to load applets from QML modules

Nicolas Fella requested to merge work/nico/applet-qml-module into master

Currently we deploy an applet's QML code via KPackage, i.e. files on disk.

This means they do not get processed by qmlcachegen and thus do not get compiled to C++

We also cannot directly use declarative type registration for C++ backed types and need to use auxiliary QML modules.

This patch introduces a new way of loading applets. Via qt_add_qml_module we add the QML source to the plugin binary. This will place the (compiled) QML files in the plugin's resources where the shell then loads them.

The applet metadata is shipped via the usual plugin metadata mechanism. To still allow for applets without a custom C++ class we optionally generate a trivial applet class to hold the metadata.

This is tied together with a new CMake API, plasma_add_applet().

The old way of loading applets via pure KPackage or KPackage+plugin is still fully supported for compatibility, particularly for store applets

Merge request reports