From ded5e7184b5078864928d670a3b89e0e8aa88dda Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 4 Feb 2010 16:51:45 +1000 Subject: Document QmlContext ownership. --- doc/src/declarative/qtbinding.qdoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index ffef345..cae0263 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -124,7 +124,10 @@ Rectangle { Context properties work just like normal properties in QML bindings - if the \c backgroundColor context property in the previous example was changed to red, the component object instances would -all be automatically updated. +all be automatically updated. Note that it is the responsibility of the creator to delete any +QmlContext it constructs. If the \c windowContext in the example above is no longer needed when +the \c window component instantiation is destroyed, the \c windowContext must be destroyed +explicitly. The simplest way to ensure this is to set \c window as \c windowContext's parent. QmlContexts form a tree - each QmlContext except for the root context has a parent. Child QmlContexts effectively inherit the context properties present in their parents. This gives -- cgit v0.12