aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-01-10 12:33:44 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-01-24 18:20:06 +0000
commit8645d40d06b967a2bf3c0c21cd485ad3588f404b (patch)
tree3824d5dda7906f424bf8fc18a9b4a71a718d91cb /src/qml
parentf6576ccb2c5235ae8d4482d582764516be1e3cf4 (diff)
Document QQmlExtensionPlugin
You should really not use it, but people should know about it. We cannot deprecate it because QtQuick Controls needs it. Fixes: QTBUG-95448 Change-Id: Idcc31d13a8eaa709944f2271389642b7fdbe84fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 05908e67a2a281b56bad503490e5c9121e9f285a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index 2d24bd8339..9eaf113b10 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -43,6 +43,21 @@
QT_BEGIN_NAMESPACE
/*!
+ \since 5.0
+ \inmodule QtQml
+ \class QQmlExtensionPlugin
+ \brief The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins
+ with custom type registration functions.
+
+ \ingroup plugins
+
+ \note If you need to write a plugin manually (which is rare) you should always use
+ \l{QQmlEngineExtensionPlugin}. QQmlExtensionPlugin only provides the registerTypes() and
+ unregisterTypes() functions in addition. You should not use them, but rather declare your
+ types with \l{QML_ELEMENT} and friends and have the build system take care of the registration.
+*/
+
+/*!
\since 5.14
\inmodule QtQml
\class QQmlEngineExtensionPlugin
@@ -61,7 +76,6 @@ QT_BEGIN_NAMESPACE
/*!
\fn void QQmlExtensionPlugin::registerTypes(const char *uri)
- \internal
Registers the QML types in the given \a uri. Subclasses should implement
this to call qmlRegisterType() for all types which are provided by the extension
@@ -127,9 +141,10 @@ void QQmlExtensionPlugin::unregisterTypes()
}
/*!
- \internal
-*/
-
+ Initializes the extension from the \a uri using the \a engine. Here an application
+ plugin might, for example, expose some data or objects to QML,
+ as context properties on the engine's root context.
+ */
void QQmlExtensionPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
Q_UNUSED(engine);