aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/variantMapLookup.qml
blob: 75b4fd0fda167aca43162d19d78d6b6d7d7e68b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
pragma Strict
import TestTypes
import QtQuick

Item {
    id: root
    property int i: moo.data.value
    property int j: moo.many[1].value
    property string foo: moo.data.foo

    VariantMapLookupFoo {
        id: moo
        data: {
            let result = { value: 42 };
            switch(root.visible) {
                case true:
                    result.foo = "blue";
                    break;
                case false:
                    result.foo = "green";
                    break;
            }
            return result;
        }
    }

    function doI() {
        moo.data.value = i + 1
    }
}