diff options
Diffstat (limited to 'tests/manual/threading/threadedlistmodel/timedisplay.qml')
-rw-r--r-- | tests/manual/threading/threadedlistmodel/timedisplay.qml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/manual/threading/threadedlistmodel/timedisplay.qml b/tests/manual/threading/threadedlistmodel/timedisplay.qml new file mode 100644 index 0000000000..19bd694137 --- /dev/null +++ b/tests/manual/threading/threadedlistmodel/timedisplay.qml @@ -0,0 +1,42 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick + +Rectangle { + color: "white" + width: 200 + height: 300 + + ListView { + anchors.fill: parent + model: listModel + delegate: Component { + Text { + required property string time + text: time + } + } + + ListModel { id: listModel } + + WorkerScript { + id: worker + source: "dataloader.mjs" + } + +// ![0] + Timer { + id: timer + interval: 2000; repeat: true + running: true + triggeredOnStart: true + + onTriggered: { + var msg = {'action': 'appendCurrentTime', 'model': listModel}; + worker.sendMessage(msg); + } + } +// ![0] + } +} |