aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml b/tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml
new file mode 100644
index 0000000000..23e4c8d15e
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/scarceResourceFunction.var.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+import Qt.test 1.0
+
+// Here we import a scarce resource directly.
+// The copy is only assigned when retrieveScarceResource()
+// is called, and so should be detached prior to that.
+// The copy should be released when releaseScarceResource()
+// is called, and so should be detached after that.
+
+QtObject {
+ id: root
+ property MyScarceResourceObject a: MyScarceResourceObject { id: scarceResourceProvider }
+ property var scarceResourceCopy;
+
+ function retrieveScarceResource() {
+ root.scarceResourceCopy = scarceResourceProvider.scarceResource;
+ }
+
+ function releaseScarceResource() {
+ root.scarceResourceCopy = null;
+ }
+}
+