Hello,
we have code that is located in a C++ plugin (actually, a QML resource which is registered as a type via Plugin::registerTypes) which dynamically loads other QML, using a QtQuick.Loader. Lets call the registered type DynaLoader. The application which uses DynaLoader will pass in a string like “Bla.qml”.
Now it turns out that components which themselves reference other locally defined QML types (i.e., types defined in QML files that are located alongside the initially loaded one) cannot be loaded, because the referenced type is not visible. For example, let Bla.qml be:
Rectangle {
AnotherBla {
}
}
where AnotherBla.qml is located right alongside Bla.qml. Now, when at runtime we say
DynaLoader.show = "Bla.qml"
we get a message “AnotherBla is not a type”.
I have to mention that all QML files (both in the plugin and in the application) are stored as resources.
thanks
Chris
↧