summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/javascriptblocks.qdoc
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-14 13:01:13 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-12-14 13:01:13 (GMT)
commit086a010a63895c6e6d178c1de9434483f11b2d34 (patch)
treebb2542f04438b42ae5c61b1c3a6330f011700474 /doc/src/declarative/javascriptblocks.qdoc
parent0fe36ac832abf8f8d438b21fce0177b65b3bbf3a (diff)
parent5cb2226ddf96555417f08c9bfe35addfc93f6acd (diff)
downloadQt-086a010a63895c6e6d178c1de9434483f11b2d34.zip
Qt-086a010a63895c6e6d178c1de9434483f11b2d34.tar.gz
Qt-086a010a63895c6e6d178c1de9434483f11b2d34.tar.bz2
Merge branch 'qdoc-simplified' into mimir-simplified
Conflicts: tools/qdoc3/atom.h tools/qdoc3/qdoc3.pro
Diffstat (limited to 'doc/src/declarative/javascriptblocks.qdoc')
-rw-r--r--doc/src/declarative/javascriptblocks.qdoc19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index b6fad5b..16d0633 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -207,6 +207,25 @@ changes.
See \l {Property Binding} for more information.
+\section1 Receiving QML Signals in JavaScript
+
+To receive a QML signal, use the signal's \c connect() method to connect it to a JavaScript
+function.
+
+For example, the following code connects the MouseArea \c clicked signal to the \c jsFunction()
+in \c script.js:
+
+\table
+\row
+\o \snippet doc/src/snippets/declarative/integrating-javascript/connectjs.qml 0
+\o \snippet doc/src/snippets/declarative/integrating-javascript/script.js 0
+\endtable
+
+The \c jsFunction() will now be called whenever MouseArea's \c clicked signal is emitted.
+
+See \l {Connecting signals to methods and other signals} for more information.
+
+
\section1 QML JavaScript Restrictions
QML executes standard JavaScript code, with the following restrictions: