aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllist.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-12-07 16:56:05 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-12-08 12:44:11 +0000
commitba8051b7e716c34db96db6c68f03ef928760e1fb (patch)
treecba78329e88f4827cc0a237854c7b6a99ae2a2da /src/qml/qml/qqmllist.cpp
parenta83f8065be447674f1af3b69d0293c5db87ac79c (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. Change-Id: Ied7fdf87ef5edd2b237498b91b162c19bf7bc636 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ed6f55ca126c80514e886b3b400a22ba5d443589) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmllist.cpp')
-rw-r--r--src/qml/qml/qqmllist.cpp39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/qml/qml/qqmllist.cpp b/src/qml/qml/qqmllist.cpp
index 51499f816d..a3380a6c22 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