I’m trying to make a plasmoid for KDE/Plasma 6, which needs to access a network service, so, as I understand, it can’t be made with qml alone and requires C++ QML plugin.
I created a plugin that successfully builds with qt_add_qml_module cmake directive and is installed with:
qt_query_qml_module(my_sensor_plugin
QMLDIR plugin_qmldir
TYPEINFO plugin_typeinfo
TARGET_PATH plugin_targetpath
)
install(TARGETS my_sensor_plugin DESTINATION ${KDE_INSTALL_QMLDIR}/${plugin_targetpath})
install(FILES "${plugin_qmldir}" DESTINATION ${KDE_INSTALL_QMLDIR}/${plugin_targetpath})
install(FILES "${plugin_typeinfo}" DESTINATION ${KDE_INSTALL_QMLDIR}/${plugin_targetpath})
And it ends up in ~/.local/lib/qt6/qml/my_sensor/widget/dataprovider (when I install it with ~/.local install prefix for testing). This directory contains my_sensor_plugin.so, qmldir and my_sensor_plugin.qmltypes.
When qml code tries to import it, plasmawindowed shows this error:
file:///home/example/.local/share/plasma/plasmoids/my_sensor.widget/contents/ui/main.qml:5:1: module “my_sensor.widget.dataprovider” is not installed
When running plasmawindowed under strace I don’t see it trying to access anything in ~/.local/lib/qt6 at all, so it seems that it’s not a problem within plugin’s .so library or qmldir: these files aren’t even accessed.
What is the correct path to install QML C++ plugin/extension for Plasma widget?