diff options
Diffstat (limited to 'sources/pyside6/doc/extras/QtQml.QmlAttached.rst')
-rw-r--r-- | sources/pyside6/doc/extras/QtQml.QmlAttached.rst | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sources/pyside6/doc/extras/QtQml.QmlAttached.rst b/sources/pyside6/doc/extras/QtQml.QmlAttached.rst index 4331b03f9..aee6d6fd8 100644 --- a/sources/pyside6/doc/extras/QtQml.QmlAttached.rst +++ b/sources/pyside6/doc/extras/QtQml.QmlAttached.rst @@ -1,35 +1,35 @@ .. currentmodule:: PySide6.QtQml .. py:decorator:: QmlAttached -This decorator declares that the enclosing type attaches the type passed as -an attached property to other types. This takes effect if the type is exposed -to QML using a ``QmlElement()`` or ``@QmlNamedElement()`` decorator. + This decorator declares that the enclosing type attaches the type passed as + an attached property to other types. This takes effect if the type is exposed + to QML using a :deco:`QmlElement` or :deco:`QmlNamedElement` decorator. -.. code-block:: python + .. code-block:: python - QML_IMPORT_NAME = "com.library.name" - QML_IMPORT_MAJOR_VERSION = 1 - QML_IMPORT_MINOR_VERSION = 0 # Optional + QML_IMPORT_NAME = "com.library.name" + QML_IMPORT_MAJOR_VERSION = 1 + QML_IMPORT_MINOR_VERSION = 0 # Optional - @QmlAnonymous - class LayoutAttached(QObject): - @Property(QMargins) - def margins(self): - ... + @QmlAnonymous + class LayoutAttached(QObject): + @Property(QMargins) + def margins(self): + ... - @QmlElement() - @QmlAttached(LayoutAttached) - class Layout(QObject): - ... + @QmlElement() + @QmlAttached(LayoutAttached) + class Layout(QObject): + ... -Afterwards the class may be used in QML: + Afterwards the class may be used in QML: -.. code-block:: javascript + .. code-block:: javascript - import com.library.name 1.0 + import com.library.name 1.0 - Layout { - Widget { - Layout.margins: [2, 2, 2, 2] - } - } + Layout { + Widget { + Layout.margins: [2, 2, 2, 2] + } + } |