diff options
author | Thomas McGuire <thomas.mcguire.qnx@kdab.com> | 2012-08-14 11:08:33 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-28 06:21:58 +0200 |
commit | 1867868fee63d19fc61d5dde9c36e91dbb918a64 (patch) | |
tree | ac9c0e755a379615c875c28e760727a9f90c5ce1 /src | |
parent | c5e46a63b2dac24e411b904019ef9e87a832791b (diff) |
Doc: Clarify ownership semantics of objects returned by property getters
Change-Id: I8d19756e95ff02ed67b39ba4741aff4fda5896ce
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index be207089e2..1a9fc5837c 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1082,8 +1082,10 @@ void QQmlEngine::setContextForObject(QObject *object, QQmlContext *context) have been transferred to the C++ caller. Objects not-created by QML have CppOwnership by default. The - exception to this is objects returned from a C++ method call. The - ownership of these objects is passed to JavaScript. + exception to this is objects returned from C++ method calls; in these cases, + the ownership of the returned objects will be set to JavaScriptOwnerShip. + Note this applies only to explicit invocations of Q_INVOKABLE methods or slots, + and not to property getter invocations. Calling setObjectOwnership() overrides the default ownership heuristic used by QML. |