summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/javascriptblocks.qdoc
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-17 16:08:46 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-17 16:08:46 (GMT)
commite66fcc2b1897883d8ec0780c731c5989cb657cdf (patch)
tree8cac984418b97886793d973f0ee138f1412fbc14 /doc/src/declarative/javascriptblocks.qdoc
parentfd36b47e8758562fc9ff350f292fc9ae9ed91d4e (diff)
parente23a519366587cfc27ad3be88180692cb49e206f (diff)
downloadQt-e66fcc2b1897883d8ec0780c731c5989cb657cdf.zip
Qt-e66fcc2b1897883d8ec0780c731c5989cb657cdf.tar.gz
Qt-e66fcc2b1897883d8ec0780c731c5989cb657cdf.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: (29 commits) Recognize identifiers containing unicode escape sequences. Fix README Fix doc: QML_DECLARE_TYPE is no longer necessary Fix doc: remote contents requires qmldir Fixed parsing of inner labelled statements. Doc Remove unsupported plugin version flags in .pro files of declarative examples Documentation typo. More QML doc consistency. Ensure existing image is gone before next photo selection. Don't use zoomfactor. Doc: in QML use "real" and "enumeration", not "qreal" and "enum" Doc: Put "default" property label on same line as property name Wait for debug clients asynchronously instead of blocking creation of Test not reliable ResizeMode support for QGraphicsWidgets created with QDeclarativeView More class documentation fixes for declarative. Simplify QML import plugin deployment lines Add QML imports to s60installs.pro Cleanup photoviewer demo. ...
Diffstat (limited to 'doc/src/declarative/javascriptblocks.qdoc')
-rw-r--r--doc/src/declarative/javascriptblocks.qdoc20
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/src/declarative/javascriptblocks.qdoc b/doc/src/declarative/javascriptblocks.qdoc
index 8ffe58c..7c0570e 100644
--- a/doc/src/declarative/javascriptblocks.qdoc
+++ b/doc/src/declarative/javascriptblocks.qdoc
@@ -47,7 +47,7 @@ QML encourages building UIs declaratively, using \l {Property Binding} and the
composition of existing \l {QML Elements}. To allow the implementation of more
advanced behavior, QML integrates tightly with imperative JavaScript code.
-The JavaScript environment provided by QML is stricter than that in a webbrowser.
+The JavaScript environment provided by QML is stricter than that in a web browser.
In QML you cannot add, or modify, members of the JavaScript global object. It
is possible to do this accidentally by using a variable without declaring it. In
QML this will throw an exception, so all local variables should be explicitly
@@ -66,7 +66,7 @@ them.
\code
Item {
function factorial(a) {
- a = Integer(a);
+ a = parseInt(a);
if (a <= 0)
return 1;
else
@@ -104,12 +104,12 @@ Item {
}
\endcode
-Both relative and absolute JavaScript URLs can be imported. In the case of a
-relative URL, the location is resolved relative to the location of the
-\l {QML Document} that contains the import. If the script file is not accessible,
-an error will occur. If the JavaScript needs to be fetched from a network
+Both relative and absolute JavaScript URLs can be imported. In the case of a
+relative URL, the location is resolved relative to the location of the
+\l {QML Document} that contains the import. If the script file is not accessible,
+an error will occur. If the JavaScript needs to be fetched from a network
resource, the QML document has a "Loading"
-\l {QDeclarativeComponent::status()}{status} until the script has been
+\l {QDeclarativeComponent::status()}{status} until the script has been
downloaded.
Imported JavaScript files are always qualified using the "as" keyword. The
@@ -143,7 +143,7 @@ stateless library through the use of a pragma, as shown in the following example
.pragma library
function factorial(a) {
- a = Integer(a);
+ a = parseInt(a);
if (a <= 0)
return 1;
else
@@ -160,7 +160,7 @@ parameters.
\section1 Running JavaScript at Startup
It is occasionally necessary to run some imperative code at application (or
-component instance) "startup". While it is tempting to just include the startup
+component instance) startup. While it is tempting to just include the startup
script as \e {global code} in an external script file, this can have severe limitations
as the QML environment may not have been fully established. For example, some objects
might not have been created or some \l {Property Binding}s may not have been run.
@@ -180,7 +180,7 @@ Rectangle {
}
\endcode
-Any element in a QML file - including nested elements and nested QML component
+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.