-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.1
-
None
-
Windows 7, MSVC 2008
Object ownership does not seem to work the way it is described in the docs. I am trying to use a factory class written in C++ which is called from QML and returns new objects. As described at http://doc.qt.nokia.com/4.7/qdeclarativeengine.html#ObjectOwnership-enum if the new objects do not have a parent this should mean they are given JavaScript ownership and are deleted by the garbage collector. Attached is a set of test cases which demonstrate what I'm trying to do. When I run these tests what I get is:
1) If the factory method does not return a QObject *, the reported ownership is QDeclarativeEngine::CppOwnership.
2) Even when it is reported as QDeclarativeEngine::JavaScriptOwnership, the object does not get deleted by the engine, which would be expected.
- relates to
-
QTBUG-15695 QDeclarativeEngine::setObjectOwnership(CppOwnership) deletes objects
-
- Closed
-