aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/cppintegration/definetypes.qdoc
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2012-07-18 16:14:45 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-01 12:00:24 +0200
commit1eba1f23a5c0a3ab7941bf508b03b7230646befd (patch)
tree56565243ed952d9f62234ae9e78760e004b74657 /src/qml/doc/src/cppintegration/definetypes.qdoc
parent557890579f11c81182578ba6ab13f2227f6a1824 (diff)
Document qmlAttachedPropertiesObject()
This is discussed in the documentation on writing QML extensions from C++ but is not actually documented in the list of qml* functions. Change-Id: Id24be88dc3fa6d54cc5ee29e3da1686ea2732b39 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/doc/src/cppintegration/definetypes.qdoc')
-rw-r--r--src/qml/doc/src/cppintegration/definetypes.qdoc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc
index c9750de046..36105e9ba2 100644
--- a/src/qml/doc/src/cppintegration/definetypes.qdoc
+++ b/src/qml/doc/src/cppintegration/definetypes.qdoc
@@ -459,6 +459,16 @@ Additionally, the C++ implementation may access the attached object instance
that has been attached to any object by calling the
qmlAttachedPropertiesObject() function.
+For example:
+
+\code
+Message *msg = someMessageInstance();
+MessageBoardAttachedType *attached =
+ qobject_cast<MessageBoardAttachedType*>(qmlAttachedPropertiesObject<MessageBoard>(msg));
+
+qDebug() << "Value of MessageBoard.expired:" << attached->expired();
+\endcode
+
\section2 Property Value Sources
@@ -655,4 +665,4 @@ public:
};
\endcode
-*/ \ No newline at end of file
+*/