summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-04-12 06:05:11 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-04-12 07:00:11 (GMT)
commit4e406c67576848d92a1a051aa7ed4541ac1c2dba (patch)
treeb7518abdba29abc6df91ed78d606d6aad4f4ee1a /doc/src/snippets
parent29bcbcd2cacc9c9dee36fe77b6a297e42bedf6d4 (diff)
downloadQt-4e406c67576848d92a1a051aa7ed4541ac1c2dba.zip
Qt-4e406c67576848d92a1a051aa7ed4541ac1c2dba.tar.gz
Qt-4e406c67576848d92a1a051aa7ed4541ac1c2dba.tar.bz2
Move documentation code to snippet.
Diffstat (limited to 'doc/src/snippets')
-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]