diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-12-07 16:56:05 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-12-08 11:35:06 +0100 |
commit | ed6f55ca126c80514e886b3b400a22ba5d443589 (patch) | |
tree | 22c2b46f4fa33ed2be61435280ca85779aaa931a /src/qml/qml/qqmllist.cpp | |
parent | c3860cd04bbc089ef95bc441a1f8f1e46f9606f8 (diff) |
Doc: Fix occurrences of \Q_OBJECT in code snippets
'Q_OBJECT', even in a comment, interferes with automoc.
Prefixing it with a backslash solves the automoc issue,
but documentation looks wrong as content inside \code
is taken verbatim.
Move code snippets to doc/snippets and refer to them
with \snippet commands.
Pick-to: 6.0
Change-Id: Ied7fdf87ef5edd2b237498b91b162c19bf7bc636
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qml/qml/qqmllist.cpp')
-rw-r--r-- | src/qml/qml/qqmllist.cpp | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp index 3b5b1fbc60..cffdf7c907 100644 --- a/src/qml/qml/qqmllist.cpp +++ b/src/qml/qml/qqmllist.cpp @@ -436,18 +436,7 @@ QML list properties are type-safe - in this case \c {Fruit} is a QObject type th When assigning the property in a derived type, the values are appended to those of the base class. This is the default behavior. - \code - class FruitBasket : QObject { - \Q_OBJECT - QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_APPEND - Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit) - - public: - // ... - QQmlListProperty<Fruit> fruit(); - // ... - }; - \endcode + \snippet code/src_qml_qqmllist.cpp 0 \sa QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE_IF_NOT_DEFAULT \sa QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE @@ -463,18 +452,7 @@ QML list properties are type-safe - in this case \c {Fruit} is a QObject type th the base class unless it's the default property. In the case of the default property, values are appended to those of the base class. - \code - class FruitBasket : QObject { - \Q_OBJECT - QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE_IF_NOT_DEFAULT - Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit) - - public: - // ... - QQmlListProperty<Fruit> fruit(); - // ... - }; - \endcode + \snippet code/src_qml_qqmllist.cpp 1 \sa QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_APPEND \sa QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE @@ -488,18 +466,7 @@ QML list properties are type-safe - in this case \c {Fruit} is a QObject type th When assigning the property in a derived type, the values replace those of the base class. - \code - class FruitBasket : QObject { - \Q_OBJECT - QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE - Q_PROPERTY(QQmlListProperty<Fruit> fruit READ fruit) - - public: - // ... - QQmlListProperty<Fruit> fruit(); - // ... - }; - \endcode + \snippet code/src_qml_qqmllist.cpp 2 \sa QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_APPEND \sa QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE_IF_NOT_DEFAULT |