aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquicklistmodel/data/workerremovelist.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qquicklistmodel/data/workerremovelist.qml')
-rw-r--r--tests/auto/qml/qquicklistmodel/data/workerremovelist.qml33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qml/qquicklistmodel/data/workerremovelist.qml b/tests/auto/qml/qquicklistmodel/data/workerremovelist.qml
new file mode 100644
index 0000000000..bdb5e024d8
--- /dev/null
+++ b/tests/auto/qml/qquicklistmodel/data/workerremovelist.qml
@@ -0,0 +1,33 @@
+import QtQuick 2.0
+
+Item {
+ id: item
+ property variant model
+ property bool done: false
+
+ WorkerScript {
+ id: worker
+ source: "workerremovelist.js"
+ onMessage: {
+ item.done = true
+ }
+ }
+
+ function addList() {
+ model.append({ 'data': [ { 'subData': 1 } ] });
+
+ var element = model.get(0);
+ }
+
+ function removeListViaWorker() {
+ done = false
+ var msg = { 'action': 'removeList', 'model': model }
+ worker.sendMessage(msg);
+ }
+
+ function doSync() {
+ done = false
+ var msg = { 'action': 'dosync', 'model': model }
+ worker.sendMessage(msg);
+ }
+}