summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/workerscript.qml
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-30 08:44:56 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-30 08:44:56 (GMT)
commit36c82d1a6c6d84b95c65b9df48d38093cadfd94a (patch)
treef172db63847b2240f22db5fae4df07a9eab0fa7e /doc/src/snippets/declarative/workerscript.qml
parent1acc9bcf4c43851af2096539eda88da9ef58bce3 (diff)
parentb371999d3e9c207047be6afda89d008b6cf04763 (diff)
downloadQt-36c82d1a6c6d84b95c65b9df48d38093cadfd94a.zip
Qt-36c82d1a6c6d84b95c65b9df48d38093cadfd94a.tar.gz
Qt-36c82d1a6c6d84b95c65b9df48d38093cadfd94a.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'doc/src/snippets/declarative/workerscript.qml')
-rw-r--r--doc/src/snippets/declarative/workerscript.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/workerscript.qml b/doc/src/snippets/declarative/workerscript.qml
new file mode 100644
index 0000000..838e7e5
--- /dev/null
+++ b/doc/src/snippets/declarative/workerscript.qml
@@ -0,0 +1,24 @@
+//![0]
+import Qt 4.7
+
+Rectangle {
+ width: 300; height: 300
+
+ Text {
+ id: myText
+ text: 'Click anywhere'
+ }
+
+ WorkerScript {
+ id: myWorker
+ source: "script.js"
+
+ onMessage: myText.text = messageObject.reply
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: myWorker.sendMessage({ 'x': mouse.x, 'y': mouse.y })
+ }
+}
+//![0]