QML_RUNTIME_TESTING should be disabled by default.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativeecmascript / data / propertyVar.reparent.qml
1 import QtQuick 2.0
2
3 Item {
4     id: root
5     objectName: "separateRootObject"
6     property var vp
7
8     function constructGarbage() {
9         var retn = 1;
10         var component = Qt.createComponent("PropertyVarOwnershipComponent.qml");
11         if (component.status == Component.Ready) {
12             retn = component.createObject(null); // has JavaScript ownership
13         }
14         return retn;
15     }
16
17     function assignVarProp() {
18         vp = constructGarbage();
19         gc();
20     }
21
22     function deassignVarProp() {
23         vp = 2;
24         gc();
25     }
26 }
27