~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlecmascript/data/propertyVar.6.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
Item {
 
4
    property bool test: false
 
5
 
 
6
    property var items: [1, 2, 3, "four", "five"]
 
7
    property int bound: items[0]
 
8
    property var funcs: [(function() { return 6; })]
 
9
    property int bound2: funcs[0]()
 
10
 
 
11
    function returnTwenty() {
 
12
        return 20;
 
13
    }
 
14
 
 
15
    Component.onCompleted: {
 
16
        if (bound != 1) return false;
 
17
        if (bound2 != 6) return false;
 
18
 
 
19
        items = [10, 2, 3, "four", "five"]  // bound should now be 10
 
20
        funcs = [returnTwenty]              // bound2 should now be 20
 
21
 
 
22
        if (bound != 10) return false;
 
23
        if (bound2 != 20) return false;
 
24
 
 
25
        test = true;
 
26
    }
 
27
}