diff options
Diffstat (limited to 'examples/declarative/threading/threadedlistmodel/timedisplay.qml')
-rw-r--r-- | examples/declarative/threading/threadedlistmodel/timedisplay.qml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/declarative/threading/threadedlistmodel/timedisplay.qml b/examples/declarative/threading/threadedlistmodel/timedisplay.qml new file mode 100644 index 0000000..bad7010 --- /dev/null +++ b/examples/declarative/threading/threadedlistmodel/timedisplay.qml @@ -0,0 +1,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] |