summaryrefslogtreecommitdiffstats
path: root/examples/declarative/listmodel-threaded/timedisplay.qml
blob: bad7010debf53cf06def841fbd3f073bf1310774 (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
31
32
// ![0]
import Qt 4.7

ListView {
    width: 200
    height: 300

    model: listModel
    delegate: Component {
        Text { text: time }
    }

    ListModel { id: listModel }

    WorkerScript {
        id: worker
        source: "dataloader.js"
    }

    Timer {
        id: timer
        interval: 2000; repeat: true
        running: true
        triggeredOnStart: true

        onTriggered: {
            var msg = {'action': 'appendCurrentTime', 'model': listModel};
            worker.sendMessage(msg);
        }
    }
}
// ![0]