~loic.molinari/+junk/qtdeclarative-shadereffectsource-changes

« back to all changes in this revision

Viewing changes to tests/auto/qml/qquicklistmodel/data/workerremovelist.qml

  • Committer: Loïc Molinari
  • Date: 2012-04-21 17:59:51 UTC
  • Revision ID: loic.molinari@canonical.com-20120421175951-bqx68caaf5zrp76l
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
Item {
 
4
  id: item
 
5
  property variant model
 
6
  property bool done: false
 
7
 
 
8
  WorkerScript {
 
9
    id: worker
 
10
    source: "workerremovelist.js"
 
11
    onMessage: {
 
12
      item.done = true
 
13
    }
 
14
  }
 
15
 
 
16
  function addList() {
 
17
    model.append({ 'data': [ { 'subData': 1 } ] });
 
18
 
 
19
    var element = model.get(0);
 
20
  }
 
21
 
 
22
  function removeListViaWorker() {
 
23
    done = false
 
24
    var msg = { 'action': 'removeList', 'model': model }
 
25
    worker.sendMessage(msg);
 
26
  }
 
27
 
 
28
  function doSync() {
 
29
    done = false
 
30
    var msg = { 'action': 'dosync', 'model': model }
 
31
    worker.sendMessage(msg);
 
32
  }
 
33
}