aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc')
-rw-r--r--src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc b/src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc
index 8206dc011b..22d72c101b 100644
--- a/src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc
+++ b/src/qml/doc/src/cmake/qt_generate_foreign_qml_types.qdoc
@@ -65,4 +65,13 @@ the \c QML_ELEMENT macro).
The effect is equivalent to using \c QML_FOREIGN with custom structs in the QML library to expose
the types.
+
+\note In order to implement custom behavior, such as exposing an existing
+singleton instance with its own life cycle to QML, you should add custom types
+to your QML library (mylib_declarative in the above example). In turn, you
+should omit the \l QML_ELEMENT and similar macros from the original C++ classes
+so that qt_generate_foreign_qml_types() does not generate more QML integration
+structs for them. The QML macros, as well as any singleton factory functions,
+can be added to the structs that contain the \l QML_FOREIGN.
+
*/