Type: Technical task
Priority: P1: Critical
Fix Version/s: 6.2.0 Beta2
Many QML plugins only serve to dynamically load their base libaries. The qtquick2 plugin is linked to libQtQuick.so and loading it loads the types in the QtQuick module. The same holds for QtQml.WorkerScript, QtQml.Models, and most of the QtQuickControls2 style plugins. Furthermore, the headers of types defined in plugins are inaccessible to the QML compiler. Therefore, all types we actually want to use have to be defined in the base libraries.
The way forward is to have an extra parameter to check whether the module in question is already loadable when parsing the qmldir file. If so, no plugin has to be loaded. Therefore if you do the equivalent of "QT += quick" to link QtQuick into your application, you can skip the plugin loading.
An extra directive in the qmldir file shall be given to tell the user to do this rather than rely on the plugin loading.
Furthermore, eventually the QML type loader should at least optionally warn when loading a plugin. We should push users towards linking the libraries that contain the types rather than loading them at runtime.