Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
6.2.0 Beta2
Description
i'm trying to use the cmake targets for qml plugins with statically linked qt. however i'm facing challenges to find out the names of a specific plugin.
the first issue i'm having is a documentation issue: i did not find out which cmake targets to link to. for c++ classes this is in the docs (e.g. https://doc-snapshots.qt.io/qt6-dev/qbuffer.html), for qml classes it only mentions the import statement (https://doc-snapshots.qt.io/qt6-dev/qml-qtquick-layouts-rowlayout.html)
the second issue i'm seeing is a lack of consistency among the qml plugins:
- `Qt.labs.animation` is `Qt6::labsanimationplugin`
- `Qt.labs.sharedimage` is `Qt6::sharedimageplugin`
- `Qt.labs.wavefrontmesh` is `Qt6::qmlwavefrontmeshplugin`
- `QtQml.Models` is `Qt6::modelsplugin`
- `QtQuick.Controls` is `Qt6::qtquickcontrols2plugin`
- `QtQuick.Dialogs` correspondst to `Qt6::qtquickdialogsplugin`
- `QtQuick.Layouts` is `Qt6::qquicklayoutsplugin`
- `QtQuick.Shapes` is `Qt6::qmlshapesplugin`
- `QtQuick.Templates` is `Qt6::qtquicktemplates2plugin`
- `QtQuick.Window` is `Qt6::quickwindow`
so there are various prefixes ("labs", "qml", "qtquick", "qquick"). sometimes there's a version specifier (with Controls and Templates). usually there's a "plugin" suffix, but not always.
third issue: the `_init` plugins to auto-load the plugin targets are not pulled in as usage requirement of the plugins. linking qml plugins without auto-loading is quite useless imho
and last issue: the plugins don't carry dependencies. afaict `QtQml.Models` for example is pulled at dependency (of QtQml and QtQuick). however i explicitly need to link both `Qt6::modelsplugin` and `Qt6::modelsplugin_init` explicitly to resolve the dependency
—
i know that the qml import scanner takes care of this under the hood and it's super convenient to use: but it significantly increases the cmake execution times, when using multiple (dozens) of targets, as for each target the import scanner takes 10-15 seconds
Attachments
Issue Links
- relates to
-
QTBUG-83498 Fix handling of plugins in static builds (and the dependency cycles it creates)
- Open
-
QTBUG-103187 Reconfiguration is slow due to qmlimportscanner
- Closed
-
QTBUG-92933 Rework automatic static plugin linkage
- Closed
-
QTBUG-95140 Revise what should be the default target and output name of a qml plugin
- Closed
-
QTBUG-92887 [cmake] qt6_import_qml_plugins without import scanner
- Reported