From 48241a49d96f27cfb64218a91a3aa7a8d1174a91 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Wed, 3 Jan 2024 08:57:58 +0100 Subject: [PATCH] Extend the Q_IMPORT_QML_PLUGIN documentation Add the explanation what is PluginName and how it's computed when using the modern QML API. Fixes: QTBUG-119372 Pick-to: 6.2 6.5 6.6 6.7 Change-Id: I7346f7b7f82c717ee79b07f4dcec0c0d1dc733b2 Reviewed-by: Ulf Hermann Reviewed-by: Leena Miettinen --- src/qml/qml/qqmlextensionplugin.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index 450ffff44d..5af51769ab 100644 --- a/src/qml/qml/qqmlextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -166,8 +166,20 @@ void QQmlEngineExtensionPlugin::initializeEngine(QQmlEngine *engine, const char \since 6.2 \relates QQmlEngineExtensionPlugin - Ensures the plugin whose metadata-declaring class is named \a PluginName - is linked into static builds. + Ensures the plugin whose metadata-declaring plugin extension class is named + \a PluginName is linked into static builds. For the modules created using + \l qt_add_qml_module, the default plugin extension class name is computed + from the QML module URI by replacing dots with underscores, unless the + \c CLASS_NAME argument is specified. + + For example: + \badcode + qt_add_qml_module(myplugin + # The plugin extension class name in this case is my_Company_QmlComponents. + URI my.Company.QmlComponents + ... + ) + \endcode \sa Q_IMPORT_PLUGIN */