aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/doc/extras
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-08 15:48:33 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-10 19:58:33 +0100
commit4f57d4eb32df52838129547be60b1a75d3f3356c (patch)
tree19f625c23ebd5ecdbe6cd9f30e71832f0df15d4a /sources/pyside6/doc/extras
parent5b9320df2284b96dba4d5eec1857a797797187e6 (diff)
PySide6: Add a QmlAnonymous decorator
Split out a helper from the qmlElementMacro() to register (also preparing for uncreatable types) and add the decorator. Pick-to: 6.2 Change-Id: I0f3ebf6f31c141083440abcc9f1acd227ce046d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/doc/extras')
-rw-r--r--sources/pyside6/doc/extras/QtQml.QmlAnonymous.rst22
1 files changed, 22 insertions, 0 deletions
diff --git a/sources/pyside6/doc/extras/QtQml.QmlAnonymous.rst b/sources/pyside6/doc/extras/QtQml.QmlAnonymous.rst
new file mode 100644
index 000000000..a805b0763
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtQml.QmlAnonymous.rst
@@ -0,0 +1,22 @@
+.. currentmodule:: PySide6.QtQml
+.. _QmlAnonymous:
+
+QmlAnonymous
+************
+
+.. py:decorator:: QmlAnonymous
+
+ Declares the enclosing type to be available, but anonymous in QML. The type
+ cannot be created or used to declare properties in QML, but when passed from
+ C++, it is recognized. In QML, you can use properties of this type if they
+ are declared in C++.
+
+ .. code-block:: python
+
+ QML_IMPORT_NAME = "com.library.name"
+ QML_IMPORT_MAJOR_VERSION = 1
+ QML_IMPORT_MINOR_VERSION = 0 # Optional
+
+ @QmlAnonymous
+ class ClassForQml(QObject):
+ # ...