How to use enums from a C++ singleton in another QML plugin (Qt 6, qt_add_qml_module)
-
I have a Qt 6 project with two QML plugins created using qt_add_qml_module.
Plugin A contains QML files.
Plugin B contains a C++ singleton class that defines several enums.I want to use the enums from the singleton in Plugin B inside the QML files of Plugin A.
What is the correct way to expose the singleton enums to QML across plugins, and how should the plugins be linked/imported?
-
Hi,
AFAIK, if you want to share stuff between different plugins, use a shared library that contains that stuff and link it to both plugins.