diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-11-25 05:27:18 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-11-25 05:27:18 (GMT) |
commit | 50ef19f6eca9d433deed3f3c7062901a5d2f292c (patch) | |
tree | 3ce670f8aacf2fee55da3d8b641da04a6739f775 /src/declarative/qml/qmlscript.cpp | |
parent | ad543e4edbe69c7111542e5c57f7470e9499cffc (diff) | |
parent | d8010cfa362a3007d8e71791dea247910bf8d1f6 (diff) | |
download | Qt-50ef19f6eca9d433deed3f3c7062901a5d2f292c.zip Qt-50ef19f6eca9d433deed3f3c7062901a5d2f292c.tar.gz Qt-50ef19f6eca9d433deed3f3c7062901a5d2f292c.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlscript.cpp')
-rw-r--r-- | src/declarative/qml/qmlscript.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/declarative/qml/qmlscript.cpp b/src/declarative/qml/qmlscript.cpp index 7242498..eb0b858 100644 --- a/src/declarative/qml/qmlscript.cpp +++ b/src/declarative/qml/qmlscript.cpp @@ -43,12 +43,13 @@ /*! \qmlclass Script QmlScript - \brief The Script element adds JavaScript snippets. + \brief The Script element provides a way to add JavaScript code snippets in QML. \ingroup group_utility - QmlScript is used to add convenient JavaScript "glue" methods to - your Qt Declarative application or component. While you can have any JavaScript code - within a QmlScript, it is best to limit yourself to defining functions. + The Script element is used to add convenient JavaScript "glue" methods to + your Qt Declarative application or component. + + An example: \qml Script { @@ -60,23 +61,27 @@ MouseRegion { onClicked: debugMyComponent() } \endqml - \note QmlScript executes JavaScript as soon as it is specified. - When defining a component, this may be before the execution context is - fully specified. As a result some properties or items may not be - accessible. By limiting your JavaScript to defining functions that are - only executed later once the context is fully defined, this problem is - avoided. + \note While it is possible to use any JavaScript code within a Script element, + it is recommended that the code be limited to defining functions. The Script + element executes JavaScript as soon as it is specified, so + when defining a component, this may be done before the execution context is + fully specified. As a result, some properties or items may not be + accessible. You can avoid this problem by limiting your JavaScript to + defining functions that are only executed later once the context is fully + defined. + + \sa {ECMAScript Blocks} */ /*! \qmlproperty string Script::script \default - JavaScript code to execute. + The JavaScript code to be executed. */ /*! \qmlproperty url Script::source - Setting this property causes the Script element to read JavaScript code from - the file specified. + Specifies a source file containing JavaScript code. This can be used instead + of providing inline JavaScript code in the Script element. */ |