summaryrefslogtreecommitdiffstats
path: root/doc/src/objectmodel/properties.qdoc
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-02-08 14:45:11 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-02-08 14:45:11 (GMT)
commite442cb8e772eeebbe66ebc89a4d6a429d12f86cb (patch)
treef706685c49bbdfb13eb3fa4ce3a95cf4d4e4b472 /doc/src/objectmodel/properties.qdoc
parentc39b3d42dda26b1f9576906cd001236c9d96e06a (diff)
downloadQt-e442cb8e772eeebbe66ebc89a4d6a429d12f86cb.zip
Qt-e442cb8e772eeebbe66ebc89a4d6a429d12f86cb.tar.gz
Qt-e442cb8e772eeebbe66ebc89a4d6a429d12f86cb.tar.bz2
Doc: Ensured that code snippets have appropriate file names.
This helps them to be marked up correctly in cases where code markers are available.
Diffstat (limited to 'doc/src/objectmodel/properties.qdoc')
-rw-r--r--doc/src/objectmodel/properties.qdoc16
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/src/objectmodel/properties.qdoc b/doc/src/objectmodel/properties.qdoc
index 7d1ecec..77421c5 100644
--- a/doc/src/objectmodel/properties.qdoc
+++ b/doc/src/objectmodel/properties.qdoc
@@ -46,12 +46,12 @@
To declare a property, use the \l {Q_PROPERTY()} {Q_PROPERTY()}
macro in a class that inherits QObject.
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 0
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 0
Here are some typical examples of property declarations taken from
class QWidget.
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 1
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 1
A property behaves like a class data member, but it has additional
features accessible through the \l {Meta-Object System}.
@@ -131,7 +131,7 @@
be a user-defined type. In this example, class QDate is considered
to be a user-defined type.
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 2
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 2
Because QDate is user-defined, you must include the \c{<QDate>}
header file with the property declaration.
@@ -152,7 +152,7 @@
the code snippet below, the call to QAbstractButton::setDown() and
the call to QObject::setProperty() both set property "down".
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 3
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 3
Accessing a property through its \c WRITE accessor is the better
of the two, because it is faster and gives better diagnostics at
@@ -162,7 +162,7 @@
can \e discover a class's properties at run time by querying its
QObject, QMetaObject, and \l {QMetaProperty} {QMetaProperties}.
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 4
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 4
In the above snippet, QMetaObject::property() is used to get \l
{QMetaProperty} {metadata} about each property defined in some
@@ -189,7 +189,7 @@
for the \c READ and \c WRITE functions. The declaration of MyClass
then might look like this:
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 5
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 5
The \c READ function is const and returns the property type. The
\c WRITE function returns void and has exactly one parameter of
@@ -200,7 +200,7 @@
QObject that is an instance of MyClass, we have two ways to set
its priority property:
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 6
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 6
In the example, the enumeration type that is the property type is
declared in MyClass and registered with the \l{Meta-Object System}
@@ -262,7 +262,7 @@
Q_CLASSINFO(), that can be used to attach additional
\e{name}--\e{value} pairs to a class's meta-object, for example:
- \snippet doc/src/snippets/code/doc_src_properties.qdoc 7
+ \snippet doc/src/snippets/code/doc_src_properties.cpp 7
Like other meta-data, class information is accessible at run-time
through the meta-object; see QMetaObject::classInfo() for details.