1 .import Qt.test 1.0 as JsQtTest
3 // In this case, the "retn" variable will be evaluated during import.
4 // Since the importScarceResource() function depends on this variable,
5 // because we DO NOT call "retn.preserve()", the scarce resource will
6 // be released after the import completes but prior to evaluation of
7 // any binding which calls "importScarceResource()".
8 // Thus, "importScarceResource()" will return a released (invalid)
11 var component = Qt.createComponent("scarceResourceCopyNoBinding.var.qml");
12 var scarceResourceElement = component.createObject(null);
13 var scarceResourceProvider = scarceResourceElement.a;
14 var retn = scarceResourceProvider.scarceResource;