diff --git a/src/corelib/doc/snippets/code/doc_src_properties.cpp b/src/corelib/doc/snippets/code/doc_src_properties.cpp index 4019fee583b..190a8437101 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 a05c21120cf..80a0c98cf95 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++} */ diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 3fd588f47b5..a131caedeec 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4417,19 +4417,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++} */ /*!