From a5336a0577b715edf49bef3794c6b1a8fa225a73 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 23 Apr 2012 14:39:48 +1000 Subject: More example docs MouseArea, Threading and TouchInteraction Change-Id: I9ca812d20a6c87d68ef91066ae0a4b9bc8829478 Reviewed-by: Michael Brasser --- examples/quick/threading/workerscript/workerscript.js | 4 ++-- examples/quick/threading/workerscript/workerscript.qml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'examples/quick/threading/workerscript') diff --git a/examples/quick/threading/workerscript/workerscript.js b/examples/quick/threading/workerscript/workerscript.js index ada3d82589..67fbd8af9a 100644 --- a/examples/quick/threading/workerscript/workerscript.js +++ b/examples/quick/threading/workerscript/workerscript.js @@ -12,7 +12,7 @@ function triangle(row, column) { return 1; return triangle(row-1, column-1) + triangle(row-1, column); } - +//! [0] WorkerScript.onMessage = function(message) { //Calculate result (may take a while, using a naive algorithm) var calculatedResult = triangle(message.row, message.column); @@ -21,4 +21,4 @@ WorkerScript.onMessage = function(message) { column: message.column, result: calculatedResult} ); } - +//! [0] diff --git a/examples/quick/threading/workerscript/workerscript.qml b/examples/quick/threading/workerscript/workerscript.qml index 640df0b483..d66628e79e 100644 --- a/examples/quick/threading/workerscript/workerscript.qml +++ b/examples/quick/threading/workerscript/workerscript.qml @@ -43,6 +43,7 @@ import QtQuick 2.0 Rectangle { width: 320; height: 480 +//! [1] WorkerScript { id: myWorker source: "workerscript.js" @@ -56,10 +57,12 @@ Rectangle { } } } +//! [1] Row { y: 24 spacing: 24 anchors.horizontalCenter: parent.horizontalCenter +//! [0] Spinner { id: rowSpinner label: "Row" @@ -68,6 +71,7 @@ Rectangle { myWorker.sendMessage( { row: rowSpinner.value, column: columnSpinner.value } ); } } +//! [0] Spinner { id: columnSpinner -- cgit v1.2.3