--- a/src/declarative/qml/qdeclarativeworkerscript.cpp Tue Jul 06 15:10:48 2010 +0300
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp Wed Aug 18 10:37:55 2010 +0300
@@ -295,6 +295,7 @@
ctxt->pushScope(urlContext);
ctxt->pushScope(activation);
ctxt->setActivationObject(activation);
+ QDeclarativeScriptParser::extractPragmas(script);
workerEngine->baseUrl = url;
workerEngine->evaluate(script);
@@ -520,9 +521,9 @@
that the main GUI thread is not blocked.
Messages can be passed between the new thread and the parent thread
- using sendMessage() and the onMessage() handler.
+ using \l sendMessage() and the \l {WorkerScript::onMessage}{onMessage()} handler.
- Here is an example:
+ An example:
\snippet doc/src/snippets/declarative/workerscript.qml 0
@@ -540,6 +541,9 @@
called, triggering the \tt WorkerScript.onMessage() handler in
\tt script.js. This in turn sends a reply message that is then received
by the \tt onMessage() handler of \tt myWorker.
+
+ \sa {declarative/threading/workerscript}{WorkerScript example},
+ {declarative/threading/threadedlistmodel}{Threaded ListModel example}
*/
QDeclarativeWorkerScript::QDeclarativeWorkerScript(QObject *parent)
: QObject(parent), m_engine(0), m_scriptId(-1), m_componentComplete(true)
@@ -554,7 +558,7 @@
/*!
\qmlproperty url WorkerScript::source
- This holds the url of the javascript file that implements the
+ This holds the url of the JavaScript file that implements the
\tt WorkerScript.onMessage() handler for threaded operations.
*/
QUrl QDeclarativeWorkerScript::source() const
@@ -575,7 +579,7 @@
emit sourceChanged();
}
-/*
+/*!
\qmlmethod WorkerScript::sendMessage(jsobject message)
Sends the given \a message to a worker script handler in another