summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/workerscript.qml
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-04-19 08:45:09 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-04-19 08:45:09 (GMT)
commit0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014 (patch)
treef9b0b9e50f70b8f24e29c1966ebd23ffa3377a40 /doc/src/snippets/declarative/workerscript.qml
parentbce9c47d5437812b137c47ff3c602ff23ffa5e22 (diff)
parent5ce428cf7f20cd37f4cf0d92ddcceddd07c5a0db (diff)
downloadQt-0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014.zip
Qt-0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014.tar.gz
Qt-0bbf0c7c189e3a3fd7860aae86d2f62d4bc77014.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]