summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/javascriptblocks.qdoc
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-27 16:42:14 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-27 16:42:14 (GMT)
commita17339e943f21bb6c6e16884f716dd9ab8f94938 (patch)
treef75b19e3a5f9d436c00c6b269488414513d943c5 /doc/src/declarative/javascriptblocks.qdoc
parentc78fb096c31df3b7d3cd9018f26518f59f4fde65 (diff)
parentba97ea29d33acf9ab421f4d8ef5202ec83231d7e (diff)
downloadQt-a17339e943f21bb6c6e16884f716dd9ab8f94938.zip
Qt-a17339e943f21bb6c6e16884f716dd9ab8f94938.tar.gz
Qt-a17339e943f21bb6c6e16884f716dd9ab8f94938.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: (30 commits) Ensure text document is created before we access it. Plugins documentation. Fix update issue when an item has an effect and child. Fix QDeclarativeTextInput and QGraphicsView in regards of input methods hints. Disallow "Qt" as namespace import Don't "adjust" the z value of a delegate that has been cached. Correctly inherit extension properties Autotests More QDeclarativeNetworkAccessManagerFactory doc clarification. Fix QDeclarativeNetworkAccessManagerFactory docs. Don't crash on invalid model remove signal. Ensure scheduled layout can occur before testing. Fix remaining 4.6 type registrations (to 4.7). doc anchor margins vs. anchor (line) state/animation. These examples should not be included in this test Unify naming of settings / UI to be "Qt Qml Runtime" Improved error messages for type resolving, new debug option Link to example files from tutorial pages Add tutorial for writing QML extensions no export in plugin ...
Diffstat (limited to 'doc/src/declarative/javascriptblocks.qdoc')
-rw-r--r--doc/src/declarative/javascriptblocks.qdoc17
1 files changed, 11 insertions, 6 deletions
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index 7c0570e..2db7e8e 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -75,7 +75,7 @@ Item {
MouseArea {
anchors.fill: parent
- onClicked: print(factorial(10))
+ onClicked: console.log(factorial(10))
}
}
\endcode
@@ -99,7 +99,7 @@ import "factorial.js" as MathFunctions
Item {
MouseArea {
anchors.fill: parent
- onClicked: print(MathFunctions.factorial(10))
+ onClicked: console.log(MathFunctions.factorial(10))
}
}
\endcode
@@ -184,6 +184,9 @@ Any element in a QML file - including nested elements and nested QML component
instances - can use this attached property. If there is more than one \c onCompleted()
handler to execute at startup, they are run sequentially in an undefined order.
+Likewise, the \l {Component::onDestruction} attached property is triggered on
+component destruction.
+
\section1 QML JavaScript Restrictions
QML executes standard JavaScript code, with the following restrictions:
@@ -204,16 +207,18 @@ is illegal in QML.
\code
// Illegal modification of undeclared variable
a = 1;
-for (var ii = 1; ii < 10; ++ii) a = a * ii;
- console.log("Result: " + a);
+for (var ii = 1; ii < 10; ++ii)
+ a = a * ii;
+console.log("Result: " + a);
\endcode
It can be trivially modified to this legal code.
\code
var a = 1;
-for (var ii = 1; ii < 10; ++ii) a = a * ii;
- console.log("Result: " + a);
+for (var ii = 1; ii < 10; ++ii)
+ a = a * ii;
+console.log("Result: " + a);
\endcode
Any attempt to modify the global object - either implicitly or explicitly - will