diff options
author | Kai Köhne <kai.koehne@qt.io> | 2023-12-19 10:22:28 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2023-12-20 16:01:40 +0100 |
commit | 98ba0d4e95353febd5a4b14fe2eb9cbd4259bf0a (patch) | |
tree | e134aae20a3c03efbb14163f33d24c64c58e81f9 /src/corelib/kernel/qobject.cpp | |
parent | 4d7ac732557f397cc24c47bc5469db60a0c2a2cc (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/kernel/qobject.cpp')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 4dd1c91b71..ef02b87a71 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4475,19 +4475,22 @@ QDebug operator<<(QDebug dbg, const QObject *o) \relates QObject This macro associates extra information to the class, which is available - using QObject::metaObject(). Qt makes only limited use of this feature in - \l{Qt D-Bus} and \l{Qt Qml} modules. - - The extra information takes the form of a \a Name string and a \a Value - literal string. + using QObject::metaObject(). The extra information takes the form of a + \a Name string and a \a Value literal string. Example: \snippet code/src_corelib_kernel_qobject.cpp 35 + Qt makes use of the macro in \l{Qt D-Bus} and \l{Qt Qml} modules. + For instance, when defining \l{QML Object Types} in C++, you can + designate a property as the \e default one: + + \snippet code/doc_src_properties.cpp 7 + \sa QMetaObject::classInfo() \sa {Using Qt D-Bus Adaptors} - \sa {Extending QML} + \sa {Defining QML Types from C++} */ /*! |