summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2023-12-19 10:22:28 +0100
committerKai Köhne <kai.koehne@qt.io>2023-12-20 16:01:40 +0100
commit98ba0d4e95353febd5a4b14fe2eb9cbd4259bf0a (patch)
treee134aae20a3c03efbb14163f33d24c64c58e81f9 /src/corelib/doc
parent4d7ac732557f397cc24c47bc5469db60a0c2a2cc (diff)
Doc: Use Qml DefaultProperty as example for Q_CLASSINFO
Setting a DefaultProperty is arguably something more useful to people than the 'made up' version example. Also add more links to the relevant QML pages. Pick-to: 6.6 6.7 Change-Id: Id967df7ddf81511299f95b9fd24f56af671fb855 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/doc')
-rw-r--r--src/corelib/doc/snippets/code/doc_src_properties.cpp2
-rw-r--r--src/corelib/doc/src/objectmodel/properties.qdoc6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/doc/snippets/code/doc_src_properties.cpp b/src/corelib/doc/snippets/code/doc_src_properties.cpp
index 4019fee583..190a843710 100644
--- a/src/corelib/doc/snippets/code/doc_src_properties.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_properties.cpp
@@ -96,7 +96,7 @@ object->setProperty("priority", "VeryHigh");
//! [7]
-Q_CLASSINFO("Version", "3.0.0")
+Q_CLASSINFO("DefaultProperty", "content")
//! [7]
//! [8]
diff --git a/src/corelib/doc/src/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc
index a05c21120c..80a0c98cf9 100644
--- a/src/corelib/doc/src/objectmodel/properties.qdoc
+++ b/src/corelib/doc/src/objectmodel/properties.qdoc
@@ -277,7 +277,9 @@
Connected to the property system is an additional macro,
Q_CLASSINFO(), that can be used to attach additional
- \e{name}--\e{value} pairs to a class's meta-object, for example:
+ \e{name}--\e{value} pairs to a class's meta-object. This is
+ used for instance to mark a property as the \e default one
+ in the context of \l{QML Object Types}:
\snippet code/doc_src_properties.cpp 7
@@ -299,5 +301,5 @@
and the general tips on implementing and using
\l {Qt Bindable Properties}{bindable properties}.
- \sa {Qt Bindable Properties}
+ \sa {Qt Bindable Properties}, {Defining QML Types from C++}
*/