diff options
author | Bea Lam <bea.lam@nokia.com> | 2012-08-24 11:41:18 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-28 01:51:08 +0200 |
commit | 8b003170ec4998f10c97bba619bc993853df499a (patch) | |
tree | 92f26c7a5d77759bf136125c86796f1943f28c72 /src/qml/doc/src/cppintegration/data.qdoc | |
parent | 373b8f06fa331c61efd9ba5075844df60a6a4412 (diff) |
Move data ownership docs and improve docs
Move data ownership docs to where they can be found more easily.
Change-Id: Id5262cee9b082bc472e4b6ccea853c57e66489ac
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/doc/src/cppintegration/data.qdoc')
-rw-r--r-- | src/qml/doc/src/cppintegration/data.qdoc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc index 39168bfa49..5cef06a5f2 100644 --- a/src/qml/doc/src/cppintegration/data.qdoc +++ b/src/qml/doc/src/cppintegration/data.qdoc @@ -42,6 +42,20 @@ This page discusses the data types supported by the QML engine and how they are converted between QML and C++. +\section1 Data Ownership + +When data is transferred from C++ to QML, the ownership of the data always +remains with C++. The exception to this rule is when a QObject is returned from +an explicit C++ method call: in this case, the QML engine assumes ownership of +the object, unless the ownership of the object has explicitly been set to +remain with C++ by invoking QQmlEngine::setObjectOwnership() with +QQmlEngine::CppOwnership specified. + +Additionally, the QML engine respects the normal QObject parent ownership +semantics of Qt C++ objects, and will not ever take ownership of a QObject +instance which already has a parent. + + \section1 Basic Qt Data Types By default, QML recognizes the following Qt data types, which are |