Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
None
-
2ca9d70c17 (qt/qtdeclarative/dev) 2ca9d70c17 (qt/tqtc-qtdeclarative/dev) f6c45eeda3 (qt/qtdeclarative/6.3) 39756f0a23 (qt/qtdeclarative/6.4) 39756f0a23 (qt/tqtc-qtdeclarative/6.4)
Description
According to https://doc.qt.io/qt-6/qqmlengineextensionplugin.html#details, the first step is to subclass QQmlEngineExtensionPlugin and add the Q_PLUGIN_METADATA() macro.
However, doing this together with the latest CMake QML API will cause errors:
multiple definition of `qt_plugin_query_metadata' multiple definition of `qt_plugin_instance'
This is because qt_add_qml_module() + qt_add_library() already auto-generates a QQmlEngineExtensionPlugin subclass for the library, so the developer should not do this manually.
Notes
To see the auto-generator in action, simply use Qt Creator 8.0 to generate a Hello World plugin: "File" > "New Project..." > "Library" > "Qt Quick 2 Extension Plugin"
Attachments
Issue Links
- resulted in
-
QTBUG-111577 Clarify how to override automatic plugin generation
-
- Closed
-