Document function limitation of var properties
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativeecmascript / data / scarceresources / scarceResourceFunction.qml
1 import QtQuick 2.0
2 import Qt.test 1.0
3
4 // Here we import a scarce resource directly.
5 // The copy is only assigned when retrieveScarceResource()
6 // is called, and so should be detached prior to that.
7 // The copy should be released when releaseScarceResource()
8 // is called, and so should be detached after that.
9
10 QtObject {
11     id: root
12     property MyScarceResourceObject a: MyScarceResourceObject { id: scarceResourceProvider }
13     property variant scarceResourceCopy;
14
15     function retrieveScarceResource() {
16         root.scarceResourceCopy = scarceResourceProvider.scarceResource;
17     }
18
19     function releaseScarceResource() {
20         root.scarceResourceCopy = null;
21     }
22 }
23