Qt Quick application that dynamically loads Qt Quick plugins - QML dependencies
-
I've got a Qt quick application that I run windeployqt against to produce the dependencies for the application. This works great.
This application dynamically loads plugins (SO/DYLIB/DLL) on a given platform, instantiates those plugins and carries on.
This works fine except when the plugin itself tries to instantiate QML I get missing import errors such as:
ERROR: MyApp::log [plugin message] MyPlugin::activate -> qrc:/30046D46
-C622-47DE-B446-B984310542C8/qmlresources/MyQml.qml:3:1: module "QtQuick.Co
ntrols" is not installedERROR: MyApp::log [plugin message] MyPlugin::activate -> qrc:/30046D46
-C622-47DE-B446-B984310542C8/qmlresources/MyQml.qml:4:1: module "QtQuick.Layouts" is not installedEach of my plugins has an activate method that tells it to load its Qml, and I quite clearly have failed to structure my runtime dependencies properly. The long GUID string is purely to avoid resource collisions between plugins I don't control.
My question is - should I be running windeployqt against the plugin and installing those dependencies relative to the location of the plugin?
Where should the Qml dependencies of the plugin be installed - with the hosting application's Qml dependencies - or in some location relative to the location of the plugin SO/DYLIB/DLL?
Thanks :)
-
I have temporarily sidestepped this by deploying ALL of Qml's runtime dependencies with my hosting application.
I wonder if adding a path dynamically for Qt to search for Qml dependencies would work...? If I could have the plugin add that when it is instantiated - that would be great.