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.
|For Gerrit Dashboard: QTBUG-84639|
|302670,13||Allow QML plugins to be optional||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|302901,2||Move QtQuick.Window into its own library||dev||qt/qtdeclarative||Status: ABANDONED||0||0|
|302904,2||pro2cmake: Parse "optional plugin" from qmldir files||dev||qt/qtbase||Status: MERGED||+2||0|
|303016,12||Remove QtQuick.Window plugin||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|305417,6||Make the qtquick and qtqml plugins optional||dev||qt/qtdeclarative||Status: MERGED||+2||0|
|331494,2||Qt.labs.sharedimage: Mark as non optional||dev||qt/qtdeclarative||Status: MERGED||+2||0|