diff options
Diffstat (limited to 'tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml')
-rw-r--r-- | tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml new file mode 100644 index 0000000000..c21cd43e7e --- /dev/null +++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml @@ -0,0 +1,32 @@ +import QtQuick 2.0 + +Item { + id: item + property variant model + property bool done: false + + WorkerScript { + id: worker + source: "workersync.js" + onMessage: { + item.done = true + } + } + + function addItem0() { + model.append({ 'level0': [ { 'level1': 29 } ] }); + model.append({ 'level0': [ { 'level1': 37 } ] }); + } + + function addItemViaWorker() { + done = false + var msg = { 'action': 'addItem', 'model': model } + worker.sendMessage(msg); + } + + function doSync() { + done = false + var msg = { 'action': 'dosync', 'model': model } + worker.sendMessage(msg); + } +} |