summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative/advtutorial.qdoc
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-04-12 04:40:52 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-04-12 04:40:52 (GMT)
commit20a00436174faf746be14f5c36908710eeb44101 (patch)
tree4a3cbff247bf6ff9a4eb23f524d0c080c7d7f00c /doc/src/declarative/advtutorial.qdoc
parent0eb289bada4edb57de83d690c904a9c77c23caa2 (diff)
downloadQt-20a00436174faf746be14f5c36908710eeb44101.zip
Qt-20a00436174faf746be14f5c36908710eeb44101.tar.gz
Qt-20a00436174faf746be14f5c36908710eeb44101.tar.bz2
Doc fixes
Diffstat (limited to 'doc/src/declarative/advtutorial.qdoc')
-rw-r--r--doc/src/declarative/advtutorial.qdoc14
1 files changed, 6 insertions, 8 deletions
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
index 4d3bfa8..4807fd2 100644
--- a/doc/src/declarative/advtutorial.qdoc
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -175,12 +175,10 @@ and moves the new block to its position on the game canvas. This involves severa
\list
\o \l {createComponent(url file)}{createComponent()} is called to generate an element from \c Block.qml.
If the component is ready, we can call \c createObject() to create an instance of the \c Block item.
- (If a component is loaded remotely - over HTTP for example - then we would have to wait for the
- component to finish loading before calling \c createObject()).
\o If \c createObject() returned null (i.e. if there was an error while
loading the object), print the error information.
\o Place the block in its position on the board and set its width and height.
- Also, store in the blocks array for future reference.
+ Also, store it in the blocks array for future reference.
\o Finally, print error information to the console if the component could not be
loaded for some reason (for example, if the file is missing).
\endlist
@@ -242,17 +240,17 @@ As this is a tutorial about QML, not game design, we will only discuss \c handle
\section3 Enabling mouse click interaction
-To make it easier for the JavaScript code to interface with the QML elements, we have added an Item called \c gameCanvas to \c samegame.qml. It replaces the background as the item which contains the blocks, and accepts mouse input from the user. Here is the item code:
+To make it easier for the JavaScript code to interface with the QML elements, we have added an Item called \c gameCanvas to \c samegame.qml. It replaces the background as the item which contains the blocks. It also accepts mouse input from the user. Here is the item code:
\snippet declarative/tutorials/samegame/samegame3/samegame.qml 1
-The \c gameCanvas item is the exact size of the board, and has a \c score property and a \l MouseArea for input.
+The \c gameCanvas item is the exact size of the board, and has a \c score property and a \l MouseArea to handle mouse clicks.
The blocks are now created as its children, and its dimensions are used to determine the board size so that
the application scales to the available screen size.
-Since its size is bound to a multiple of \c blockSize, \c blockSize needs to be moved out of \c samegame.js and into \c samegame.qml as a QML property.
+Since its size is bound to a multiple of \c blockSize, \c blockSize was moved out of \c samegame.js and into \c samegame.qml as a QML property.
Note that it can still be accessed from the script.
-The \l MouseArea simply calls \c{handleClick()} in \c samegame.js, which determines whether the player's click should cause any blocks to be removed, and updates \c gameCanvas.score with the current score if necessary. Here is the \c handleClick() function:
+When clicked, the \l MouseArea calls \c{handleClick()} in \c samegame.js, which determines whether the player's click should cause any blocks to be removed, and updates \c gameCanvas.score with the current score if necessary. Here is the \c handleClick() function:
\snippet declarative/tutorials/samegame/samegame3/samegame.js 1
@@ -441,7 +439,7 @@ By following this tutorial you've seen how you can write a fully functional appl
\o Build your application with \l {{QML Elements}}{QML elements}
\o Add application logic \l{Integrating JavaScript}{with JavaScript code}
\o Add animations with \l {Behavior}{Behaviors} and \l{QML States}{states}
-\o Store persistent application data using the \l{Offline Storage API} or \l XMLHttpRequest
+\o Store persistent application data using, for example, the \l{Offline Storage API} or \l XMLHttpRequest
\endlist
There is so much more to learn about QML that we haven't been able to cover in this tutorial. Check out all the