diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-27 05:03:07 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-27 05:03:07 (GMT) |
commit | 29a6377c6539840ca901bdcb045a42b7832ac98a (patch) | |
tree | a4eace12b0263723f5c76ca660a1747f8b5e3a28 /doc/src/declarative/javascriptblocks.qdoc | |
parent | 5929062996c9d0d90f19198064953a0086be7741 (diff) | |
parent | 6c7ed006b0a1f006e11fd5f78dd996d65114fc98 (diff) | |
download | Qt-29a6377c6539840ca901bdcb045a42b7832ac98a.zip Qt-29a6377c6539840ca901bdcb045a42b7832ac98a.tar.gz Qt-29a6377c6539840ca901bdcb045a42b7832ac98a.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Document that animations have to be started/stopped as a group
various doc fixes
Document 'this' as undefined in QML
Diffstat (limited to 'doc/src/declarative/javascriptblocks.qdoc')
-rw-r--r-- | doc/src/declarative/javascriptblocks.qdoc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc index c41e38e..18da3d2 100644 --- a/doc/src/declarative/javascriptblocks.qdoc +++ b/doc/src/declarative/javascriptblocks.qdoc @@ -236,6 +236,31 @@ This restriction exists as the QML environment is not yet fully established. To run code after the environment setup has completed, refer to \l {Running JavaScript at Startup}. +\o The value of \c this is currently undefined in QML + +The value of \c this is undefined in QML. To refer to any element, provide +an \c id. For example: + +\qml +Item { + width: 200; height: 100 + function mouseAreaClicked(area) { + console.log("Clicked in area at: " + area.x + ", " + area.y); + } + // This will not work because this is undefined + MouseArea { + height: 50; width: 200 + onClicked: mouseAreaClicked(this) + } + // This will pass area2 to the function + MouseArea { + id: area2 + y: 50; height: 50; width: 200 + onClicked: mouseAreaClicked(area2) + } +} +\endqml + \endlist */ |