From 02f0c23d001b433e333ede211227c8021b55277e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 19 Apr 2021 13:31:07 +0200 Subject: Document that QML_SINGLETON only works with QObjects Change-Id: I18c38037cd635fa3300c761b16038b67ac3b0d74 Reviewed-by: Fabian Kosmale (cherry picked from commit 03a2e51063de99f85b3b801c7ccd6663163a61b0) --- src/qml/doc/src/qmlfunctions.qdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qml/doc/src/qmlfunctions.qdoc') diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc index 4e531ceb61..6f5a0c4196 100644 --- a/src/qml/doc/src/qmlfunctions.qdoc +++ b/src/qml/doc/src/qmlfunctions.qdoc @@ -159,11 +159,11 @@ \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 the type's default constructor when the type is first - accessed. If there is no default constructor the singleton is initially - inaccessible. This behavior can be overridden by calling + 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 the type's default constructor + when the type is first accessed. If there is no default constructor the + singleton is initially inaccessible. This behavior can be overridden by calling \l qmlRegisterSingletonType() with a specific factory function or \l qmlRegisterSingletonInstance() with a specific instance for the same class and the same type namespace and version. -- cgit v1.2.3