aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/markJSValue.qml
blob: c115de6c57bffb8fe1a415dadd33727f1313a33c (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
import QtQml

Timer {
    id: root

    property var arr
    property var obj: ({})
    readonly property var copy1: copy(obj)
    readonly property var copy2: copy(copy1)

    function test(): void {
        arr = ["x"];
        obj = { key: { sub: {foo: 5} } };
    }

    function copy(o: var): var {
        gc();
        return JSON.parse(JSON.stringify(o));
    }

    interval: 1
    repeat: true
    running: true
    onTriggered: {
        ++count;
        test();
    }

    property int count: 0
}