aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/qmlfunctions.qdoc
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2021-04-19 13:31:07 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-19 16:58:31 +0000
commit75c7ad63797a84767c2b7529ce80d35e17d122cb (patch)
tree0e1b1fcbe914e80b5a70237fafa0d8b3d9c4bf54 /src/qml/doc/src/qmlfunctions.qdoc
parent6f378a5f1b29805b8abbc3bdb86314f0157f4af7 (diff)
Document that QML_SINGLETON only works with QObjects
Change-Id: I18c38037cd635fa3300c761b16038b67ac3b0d74 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 03a2e51063de99f85b3b801c7ccd6663163a61b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/doc/src/qmlfunctions.qdoc')
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index eb7983d077..c454d981a3 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -180,13 +180,14 @@
\relates QQmlEngine
Declares the enclosing type to be a singleton in QML. This only takes effect
- if the type is available in QML, by having a \l QML_ELEMENT or
- \l QML_NAMED_ELEMENT() macro. By default, each QQmlEngine will try to create a
- singleton instance using either the type's default constructor or a static
- factory function of the signature \c{T *create(QQmlEngine *, QJSEngine *)}
- when the type is first accessed. If both do exist and are accessible, the
- default constructor is preferred. If there is no default constructor and no
- factory function the singleton is initially inaccessible.
+ if the type is a \l Q_OBJECT and is available in QML (by having a
+ \l QML_ELEMENT or \l QML_NAMED_ELEMENT() macro). By default, each QQmlEngine
+ will try to create a singleton instance using either the type's default
+ constructor or a static factory function of the signature
+ \c{T *create(QQmlEngine *, QJSEngine *)} when the type is first accessed.
+ If both do exist and are accessible, the default constructor is preferred.
+ If there is no default constructor and no factory function the singleton is
+ initially inaccessible.
\sa QML_ELEMENT, QML_NAMED_ELEMENT(), qmlRegisterSingletonInstance().
*/