Use V4 binding for non-final properties where possible
[profile/ivi/qtdeclarative.git] / tests / auto / qml / qqmlecmascript / data / propertyQJSValue.6.qml
1 import QtQuick 2.0
2 import Qt.test 1.0
3
4 Item {
5     property bool test: false
6
7     MyQmlObject { id: itemsObj; qjsvalue: [1, 2, 3, "four", "five"] }
8     MyQmlObject { id: funcsObj; qjsvalue: [(function() { return 6; })] }
9
10     property alias items: itemsObj.qjsvalue
11     property int bound: itemsObj.qjsvalue[0]
12     property alias funcs: funcsObj.qjsvalue
13     property int bound2: funcsObj.qjsvalue[0]()
14
15     function returnTwenty() {
16         return 20;
17     }
18
19     Component.onCompleted: {
20         if (bound != 1) return false;
21         if (bound2 != 6) return false;
22
23         items = [10, 2, 3, "four", "five"]  // bound should now be 10
24         funcs = [returnTwenty]              // bound2 should now be 20
25
26         if (bound != 10) return false;
27         if (bound2 != 20) return false;
28
29         test = true;
30     }
31 }