summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-07 06:57:21 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-07 06:57:21 (GMT)
commita3a6e1622149654bc9e244e685e8e7dcbdf966b2 (patch)
tree1c4fe9feab63839213a0d97e9b24414c9585a227 /doc/src
parent99573a8e81fcea38c5f68b340068fff266315c03 (diff)
parent8b0cac9179de4d1cb34b9f17932d34cef3cd4f5b (diff)
downloadQt-a3a6e1622149654bc9e244e685e8e7dcbdf966b2.zip
Qt-a3a6e1622149654bc9e244e685e8e7dcbdf966b2.tar.gz
Qt-a3a6e1622149654bc9e244e685e8e7dcbdf966b2.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into test
Conflicts: demos/declarative/samegame/content/samegame.js tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/declarative/advtutorial.qdoc18
-rw-r--r--doc/src/declarative/advtutorial1.qdoc42
-rw-r--r--doc/src/declarative/advtutorial2.qdoc45
-rw-r--r--doc/src/declarative/advtutorial3.qdoc57
-rw-r--r--doc/src/declarative/advtutorial4.qdoc72
-rw-r--r--doc/src/declarative/binding.qdoc5
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial1.pngbin0 -> 81295 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial2.pngbin0 -> 170388 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial3.pngbin0 -> 220052 bytes
-rw-r--r--doc/src/declarative/pics/declarative-adv-tutorial4.gifbin0 -> 58337629 bytes
-rw-r--r--doc/src/declarative/pics/rect-smooth.pngbin0 -> 32162 bytes
-rw-r--r--doc/src/declarative/qmlintro.qdoc8
-rw-r--r--doc/src/declarative/qmlmodels.qdoc61
-rw-r--r--doc/src/declarative/qmlreference.qdoc7
-rw-r--r--doc/src/declarative/qtdeclarative.qdoc2
-rw-r--r--doc/src/getting-started/installation.qdoc2
-rw-r--r--doc/src/howtos/exceptionsafety.qdoc (renamed from doc/src/exceptionsafety.qdoc)2
-rw-r--r--doc/src/platforms/s60-introduction.qdoc (renamed from doc/src/s60-introduction.qdoc)4
-rw-r--r--doc/src/platforms/supported-platforms.qdoc2
-rw-r--r--doc/src/platforms/symbian-exceptionsafety.qdoc (renamed from doc/src/symbian-exceptionsafety.qdoc)0
-rw-r--r--doc/src/snippets/declarative/GroupBox.qml4
-rw-r--r--doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml2
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml12
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml14
-rw-r--r--doc/src/snippets/declarative/listview/listview.qml12
-rw-r--r--doc/src/snippets/declarative/pathview/pathattributes.qml12
-rw-r--r--doc/src/snippets/declarative/pathview/pathview.qml12
-rw-r--r--doc/src/snippets/statemachine/main2.cpp4
28 files changed, 351 insertions, 48 deletions
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc
new file mode 100644
index 0000000..c8075de
--- /dev/null
+++ b/doc/src/declarative/advtutorial.qdoc
@@ -0,0 +1,18 @@
+/*!
+\page advtutorial.html
+\title Advanced Tutorial
+
+This tutorial goes step-by-step through creating a full application using just QML. It is assumed that you already know basic QML (such as from doing the simple tutorial) and the focus is on showing how to turn that knowledge into a complete and functioning application.
+
+In this tutorial we recreate, step by step, the Same Game demo in $QTDIR/demos/declarative/samegame.qml. The results of the individual steps are in the $QTDIR/examples/declarative/tutorials/samegame directory.
+
+Tutorial chapters:
+
+\list
+\o \l {advtutorial1}{Advanced Tutorial 1 - Basic Game Screen and Block}
+\o \l {advtutorial2}{Advanced Tutorial 2 - Dynamically create the Blocks}
+\o \l {advtutorial3}{Advanced Tutorial 3 - Implement the Game Logic}
+\o \l {advtutorial4}{Advanced Tutorial 4 - Finishing Touches}
+\endlist
+
+*/
diff --git a/doc/src/declarative/advtutorial1.qdoc b/doc/src/declarative/advtutorial1.qdoc
new file mode 100644
index 0000000..48b32cd
--- /dev/null
+++ b/doc/src/declarative/advtutorial1.qdoc
@@ -0,0 +1,42 @@
+/*!
+\page advtutorial1.html
+\example declarative/tutorials/samegame/samegame1
+\title Advanced Tutorial 1 - Creating the Game canvas and block
+\target advtutorial1
+
+The first step is to create the items in your application. In Same Game we have a main game screen and the blocks that populate it.
+
+\image declarative-adv-tutorial1.png
+
+Here is the QML code for the basic elements. The game window:
+
+\snippet declarative/tutorials/samegame/samegame1/samegame.qml 0
+
+This gives you a basic game window, with room for the game canvas. A new game
+button and room to display the score. The one thing you may not recognize here
+is the SystemPalette item. This item provides access to the Qt system palette
+and is used to make the button look more like a system button (for exact native
+feel you would use a QPushButton). Since we want a fully QML button, and the Fx
+primitives don't include a button, we had to write our own. Below is the code
+which we wrote to do this:
+
+\snippet declarative/tutorials/samegame/samegame1/Button.qml 0
+
+Note that this Button component was written to be fairly generic, in case we
+want to use a similarly styled button later.
+
+And here is a simple block:
+
+\snippet declarative/tutorials/samegame/samegame1/Block.qml 0
+
+Since it doesn't do anything yet it's very simple, just an image. As the
+tutorial progresses and the block starts doing things the file will become
+more than just an image. Note that we've set the image to be the size of the itm. This will be used later, when we dynamically create and size the block items the image will be scaled automatically to the correct size.
+
+You should be familiar with all that goes on in these files so far. This is a
+very basic start and doesn't move at all - next we will populate the game canvas
+with some blocks.
+
+[\l {advtutorial.html}{Advanced Tutorial}] [Next: \l {advtutorial2}{Advanced Tutorial 2}]
+*/
+
diff --git a/doc/src/declarative/advtutorial2.qdoc b/doc/src/declarative/advtutorial2.qdoc
new file mode 100644
index 0000000..2d2fe19
--- /dev/null
+++ b/doc/src/declarative/advtutorial2.qdoc
@@ -0,0 +1,45 @@
+/*!
+\page advtutorial2.html
+\title Advanced Tutorial 2 - Populating the Game Canvas
+\target advtutorial2
+
+Now that we've written some basic elements, let's start writing the game. The
+first thing to do is to generate all of the blocks. Now we need to dynamically
+generate all of these blocks, because you have a new, random set of blocks
+every time. As they are dynamically generated every time the new game button is
+clicked, as opposed to on startup, we will be dynamically generating the blocks
+in the ECMA script, as opposed to using a Repeater.
+
+This adds enough script to justify a new file, samegame.js, the intial version
+of which is shown below
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.js 0
+
+The gist of this code is that we create the blocks dynamically, as many as will fit, and then store them in an array for future reference. The 'initBoard' function will be hooked up to the new game button soon, and should be fairly straight forward.
+
+The 'createBlock' function is a lot bigger, and I'll explain it block by block.
+First we ensure that the component has been constructed. QML elements, including composite ones like the Block.qml that we've written, are never created directly in script. While there is a function to parse and create an arbitrary QML string, in the case where you are repeatedly creating the sme item you will want to use the createComponent function. createComponent is a built-in function in the declarative ECMAscript, and returns a component object. A component object prepares and stores a QML element (usually a composite element) for easy and efficient use. When the component is ready, you can create a new instance of the loaded QML with the createObject method. If the component is loaded remotely (over HTTP fro example) then you will have to wait for the component to finish loading before calling createObject. Since we don't wait here (the waiting is a syncronous, the component object has a signal to tell you when it's done) this code will only work if the block QML is a local file.
+
+As we aren't waiting for he component, the next block of code creates a game block with component.createObject. Since there could be an error in the QML file you are trying to load, success is not guaranteed. The first bit of error checkign code comes right after createObject(), to ensure that the object loaded correctly. If it did not load correctly the function returns false, but we don't have that hooked up to the main UI to indicate that something has gone wrong. Instead we print out error messages to the console, because an error here means an invalid QML file and should only happen while you are developing and testing the UI.
+
+Next we start to set up our dynamically created block. Because the Block.qml file is generic it needs to be placed in the main scene, and in the right place. This is why parent, x, y, width and height are set. We then store it in the board array for later use.
+
+Finally, we have some more error handling. You can only call createObject if the component has loaded. If it has not loaded, either it is still loading or there was an error loading (such as a missing file). Since we don't request remote files the problem is likely to be a missing or misplaced file. Again we print this to the console to aid debugging.
+
+You now have the code to create a field of blocks dynamically, like below:
+
+\image declarative-adv-tutorial2.png
+
+To hook this code up to the 'New Game' button, you alter it as below:
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.qml 1
+
+We have just replaced the 'onClicked: print("Implement me!")' with 'onClicked: initBoard()'. Note that in order to have the function available, you'll need to include the script in the main file, by adding a script element to it.
+
+\snippet declarative/tutorials/samegame/samegame2/samegame.qml 2
+
+With those two changes, and the script file, you are now dynamically creating a field of blocks you can play with. They don't do anything now though; the next chapter will add the game mechanics.
+
+[Previous: \l {advtutorial1}{Advanced Tutorial 1}] [\l {advtutorial.html}{Advanced Tutorial}] [Next: \l {advtutorial3}{Advanced Tutorial 3}]
+
+*/
diff --git a/doc/src/declarative/advtutorial3.qdoc b/doc/src/declarative/advtutorial3.qdoc
new file mode 100644
index 0000000..635054b
--- /dev/null
+++ b/doc/src/declarative/advtutorial3.qdoc
@@ -0,0 +1,57 @@
+/*!
+\page advtutorial3.html
+\title Advanced Tutorial 3 - Implementing the Game Logic
+\target advtutorial3
+
+To the initBoard function we added clearing the board before hand, so that clicking new game won't leave the previous game lying around in the background. To the createComponent function we have added setting the type of the block to a number between one and three - it's fundamental to the game logic that the blocks be different types if you want a fun game.
+
+The main change was adding the following game logic functions:
+\list
+\o function handleClick(x,y)
+\o function floodFill(xIdx,yIdx,type)
+\o function shuffleDown()
+\o function victoryCheck()
+\o function floodMoveCheck(xIdx, yIdx, type)
+\endlist
+
+As this is a tutorial about QML, not game design, these functions will not be discussed in detail. The game logic here was written in script, but it could have been written in C++ and had these functions exposed just as well (in fact, probably faster). The interfacing between these funcions and QML is of interest though. Of these functions, only handleClick and victoryCheck interface closely with the QML. Those functions are shown below (the rest are still in the code for this tutorial located at $QTDIR/examples/declarative/tutorials/samegame).
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.js 1
+\snippet declarative/tutorials/samegame/samegame3/samegame.js 2
+
+You'll notice them referring to the 'gameCanvas' item. This is an item that has been added to the QML for easy interfacing. It is placed next to the background image and replaces the background as the item to create the blocks in. Its code is shown below:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 1
+
+This item is the exact size of the board, contains a score property, and a mouse region for input. The blocks are now created as its children, and its size is used as the noe determining board size. Since it needs to bind its size to a multiple of tileSize, tileSize needs to be moved into a QML property and out of the script file. It can still be accessed from the script.
+
+The mouse region simply calls handleClick(), which deals with the input events.Should those events cause the player to score, gameCanvas.score is updated. The score display text item has also been changed to bind its text property to gamecanvas.score. Note that if score was a global variable in the samegame.js file yo ucould not bind to it. You can only bind to QML properties.
+
+victoryCheck() mostly just updates score. But it also pops up a dialog saying 'Game Over' when the game is over. In this example we wanted a pure-QML, animated dialog, and since the Fx primitives set doesn't contain one, we wrote our own. Below is the code for the Dialog element, note how it's designed so as to be quite usable imperatively from within the script file:
+
+\snippet declarative/tutorials/samegame/samegame3/Dialog.qml 0
+
+And this is how it's used in the main QML file:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 2
+
+Combined with the line of code in victoryCheck, this causes a dialog to appear when the game is over, informing the user of that fact.
+
+We now have a working game! The blocks can be clicked, the player can score, and the game can end (and then you start a new one). Below is a screenshot of what has been accomplished so far:
+
+\image declarative-adv-tutorial3.png
+
+Here is the QML code as it is now for the main file:
+
+\snippet declarative/tutorials/samegame/samegame3/samegame.qml 0
+
+And the code for the block:
+
+\snippet declarative/tutorials/samegame/samegame3/Block.qml 0
+
+The game works, but it's a little boring right now. Where's the smooth animated transitions? Where's the high scores? If you were a QML expert you could have written these in for the first iteration, but in this tutorial they've been saved until the next chapter - where your application becomes alive!
+
+[Previous: \l {advtutorial2}{Advanced Tutorial 2}] [\l {advtutorial.html}{Advanced Tutorial}] [Next: \l {advtutorial4}{Advanced Tutorial 4}]
+
+*/
+
diff --git a/doc/src/declarative/advtutorial4.qdoc b/doc/src/declarative/advtutorial4.qdoc
new file mode 100644
index 0000000..291d2f2
--- /dev/null
+++ b/doc/src/declarative/advtutorial4.qdoc
@@ -0,0 +1,72 @@
+/*!
+\page advtutorial4.html
+\title Advanced Tutorial 4 - Finishing Touches
+\target advtutorial4
+
+Now we're going to do two things to liven the game up. Animate the blocks and add a web-based high score system.
+
+If you compare the samegame3 directory with samegame4, you'll noticed that we've cleaned the directory structure up. We now have a lot of files, and so they've been split up into folders - the most notable one being a content folder which we've placed all the QML but the main file.
+
+\section2 Animated Blocks
+
+The most vital animations are that the blocks move fluidly around the board. QML has many tools for fluid behavior, and in this case we're going to use the Follow element. By having the script set targetX and targetY, instead of x and y directly, we can set the x and y of the block to a follow. SpringFollow is a property value source, which means that you can set a property to be one of these elements and it will automatically bind the property to the element's value. The SpringFollow's value follows another value over time, when the value it is tracking changes the SpringFollow's value will also change, but it will move smoothly there over time with a spring-like movement (based on the spring parameters specified). This is shown in the below snippet of code from Block.qml:
+
+\code
+ property int targetX: 0
+ property int targetY: 0
+
+ x: SpringFollow { source: targetX; spring: 2; damping: 0.2 }
+ y: SpringFollow { source: targetY; spring: 2; damping: 0.2 }
+\endcode
+
+We also have to change the samegame.js code, so that wherever it was setting the x or y it now sets targetX and targetY (including when creating the block). This simple change is all you need to get spring moving blocks that no longer teleport around the board. If you try doing just this though, you'll notice that they now never jump from one point to another, even in the initialization! This gives an odd effect of having them all jump out of the corner (0,0) on start up. We'd rather that they fall down from the top in rows. To do this, we disable the x Follow (but not the y follow) and only enable it after we've set the x in the createBlock function. The above snippet now becomes:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 1
+
+The next-most vital animation is a smooth exit. For this animation, we'll use a Behavior element. A Behavior is also a property value source, and it is much like SpringFollow except that it doesn't model the behavior of a spring. You specify how a Behavior transitions using the standard animations. As we want the blocks to smoothly fade in and out we'll set a Behavior on the block image's opacity, like so:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 2
+
+Note that the 'opacity: 0' makes it start out transparent. We could set the opacity in the script file when we create the blocks, but instead we use states (as this is useful for the next animation we'll implement). The below snippet is set on the root element of Block.qml:
+\code
+ property bool dying: false
+ states: [
+ State{ name: "AliveState"; when: spawned == true && dying == false
+ PropertyChanges { target: img; opacity: 1 }
+ }, State{ name: "DeathState"; when: dying == true
+ PropertyChanges { target: img; opacity: 0 }
+ }
+ ]
+\endcode
+
+Now it will automatically fade in, as we set spawned to true already when implementing the block movement animations. To fade out, we set 'dying' to true instead of setting opacity to 0 when a block is destroyed (in the floodFill function).
+
+The least vital animations are a cool-looking particle effect when they get destroyed. First we create a Particles Element in the block, like so:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 3
+
+To fully understand this you'll want to look at the Particles element documentation, but it's important to note that count is set to zero.
+We next extend the 'dying' state, which triggers the particles by setting the count to non-zero. The code for the states now look like this:
+
+\snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 4
+
+And now the game should be beautifully animated and smooth, with a subtle (or not-so-subtle) animation added for all of the player's actions. The end result is shown below:
+
+\image declarative-adv-tutorial4.gif
+
+\section2 Web-based High Scores
+
+Another extension we might want for the game is some way of storing and retriveing high scores. In this tutorial we'll show you how to integrate a web enabled high score storage into your QML application. The implementation we've done is very simple - the high score data is posted to a php script running on a server somewhere, and that server then stores it and displays it to visitors. You could request an XML or QML file from that same server, which contained and displayed the scores, but that's beyond the scope of this tutorial.
+
+For better high score data, we want the name and time of the player. The time is obtained in the script fairly simply, but we have to ask the player for their name. We thus re-use the dialog QML file to pop up a dialog asking for the player's name (and if they exit this dialog without entering it they have a way to opt out of posting their high score). When the dialog is closed, if the player entered their name we can send the data to the web service in the followign snippet out of the script file:
+
+\snippet declarative/tutorials/samegame/samegame4/content/samegame.js 1
+
+This is the same XMLHttpRequest() as you'll find in browser javascript, and can be used in the same way to dynamically get XML or QML from the web service to display the high scores. We don't worry about the response here though, we just post the high score data to the web server. If it had returned a QML file (or a URL to a QML file) you could instantiate it in much the same way as you did the blocks.
+
+An alternate way to access and submit web-based data would be to use QML elements designed for this purpose - XmlListModel makes it very easy to fetch and display XML based data such as RSS in a QML application (see the Flickr demo for an example).
+
+By following this tutorial you've now ben shown how to write a fully functional application in QML, with the application logic written in a script file and with both many fluid animations and being web-enabled. Congratulations, you should now be skilled enough to write your own QML applications.
+
+[Previous: \l {advtutorial3}{Advanced Tutorial 3}] [\l {advtutorial.html}{Advanced Tutorial}]
+*/
diff --git a/doc/src/declarative/binding.qdoc b/doc/src/declarative/binding.qdoc
index 37b4c97..e6835ee 100644
--- a/doc/src/declarative/binding.qdoc
+++ b/doc/src/declarative/binding.qdoc
@@ -38,7 +38,8 @@ The QML mechanisms of data binding can also be used to bind Qt C++ objects.
The data binding framework is based on Qt's property system (see the Qt documentation for more details on this system). If a binding is meant to be dynamic (where changes in one object are reflected in another object), \c NOTIFY must be specified for the property being tracked. If \c NOTIFY is not specified, any binding to that property will be an 'intialization' binding (the tracking object will be updated only once with the initial value of the tracked object).
-Relevant items can also be bound to the contents of a Qt model. For example, ListView can make use of data from a QListModelInterface-derived model. (QListModelInterface is part of the next generation Model/View architecture being developed for Qt.)
+Relevant items can also be bound to the contents of a Qt model.
+For example, ListView can make use of data from a QAbstractItemModel-derived model.
\section1 Passing Data Between C++ and QML
@@ -107,4 +108,6 @@ Binding { target: screen; property: "brightness"; value: slider.value }
The \l QBindableMap class provides a convenient way to make data visible to the bind engine.
+C++ \l {qmlmodels}{Data Models} may also be provided to QML.
+
*/
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial1.png b/doc/src/declarative/pics/declarative-adv-tutorial1.png
new file mode 100644
index 0000000..990a329
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial1.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial2.png b/doc/src/declarative/pics/declarative-adv-tutorial2.png
new file mode 100644
index 0000000..b410d50
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial2.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial3.png b/doc/src/declarative/pics/declarative-adv-tutorial3.png
new file mode 100644
index 0000000..e192772
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial3.png
Binary files differ
diff --git a/doc/src/declarative/pics/declarative-adv-tutorial4.gif b/doc/src/declarative/pics/declarative-adv-tutorial4.gif
new file mode 100644
index 0000000..a67666d
--- /dev/null
+++ b/doc/src/declarative/pics/declarative-adv-tutorial4.gif
Binary files differ
diff --git a/doc/src/declarative/pics/rect-smooth.png b/doc/src/declarative/pics/rect-smooth.png
new file mode 100644
index 0000000..abbb0a9
--- /dev/null
+++ b/doc/src/declarative/pics/rect-smooth.png
Binary files differ
diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc
index 3d167ac..e87b7a8 100644
--- a/doc/src/declarative/qmlintro.qdoc
+++ b/doc/src/declarative/qmlintro.qdoc
@@ -40,8 +40,8 @@ two objects, a \l Rectangle, and an \l Image. Between the braces, we can specify
information about the object, such as its properties.
Properties are specified as \c {property: value} (much like CSS). In the above
-example, we can see the Image has a property named \e source, which has been
-assigned the value \e "pics/logo.png". The property and its value are
+example, we can see the Image has a property named \c source, which has been
+assigned the value \c "pics/logo.png". The property and its value are
separated by a colon.
Properties can be specified one-per-line:
@@ -68,7 +68,9 @@ In addition to assigning values to properties, you can also assign
expressions written in JavaScript.
\code
-Rotation { angle: 360*3 }
+Rotation {
+ angle: 360 * 3
+}
\endcode
These expressions can include references to other objects and properties, in which case
diff --git a/doc/src/declarative/qmlmodels.qdoc b/doc/src/declarative/qmlmodels.qdoc
new file mode 100644
index 0000000..4712de1
--- /dev/null
+++ b/doc/src/declarative/qmlmodels.qdoc
@@ -0,0 +1,61 @@
+/*!
+\page qmlmodels.html
+\target qmlmodels
+\title Data Models
+
+Some QML Items use Data Models to provide the data to be displayed.
+These items typically require a \e delegate component that
+creates an instance for each item in the model. Models may be static, or
+have items modified, inserted, removed or moved dynamically.
+
+Data is provided to the delegate via named data roles which the
+delegate may bind to. A special \e index role containing the
+index of the item in the model is also available. Models that do
+not have named roles will have the data provided via the \e modelData
+role. The \e modelData role is also provided for Models that have
+only one role. In this case the \e modelData role contains the same
+data as the named role.
+
+There are a number of QML elements that operate using data models:
+
+\list
+\o ListView
+\o GridView
+\o PathView
+\o \l {qml-repeater}{Repeater}
+\endlist
+
+QML supports several types of data model, which may be provided by QML
+or C++ (via QmlContext::setContextProperty(), for example).
+
+\section1 QML Data Models
+
+\list
+\o ListModel is a simple hierarchy of elements specified in QML. The
+available roles are specified by the \l ListElement properties.
+\o XmlListModel allows construction of a model from an XML data source. The roles
+are specified via the \l XmlRole element.
+\o VisualItemModel allows QML items to be provided as a model. This model contains
+both the data and delegate (its child items). This model does not provide any roles.
+\endlist
+
+
+\section1 C++ Data Models
+
+\list
+\o QAbstractItemModel provides the roles set via the QAbstractItemModel::setRoleNames() method.
+\o QStringList provides the contents of the list via the \e modelData role.
+\o QList<QObject*> provides the properties of the objects in the list as roles.
+\endlist
+
+
+\section1 Other Data Models
+
+\list
+\o An Integer specifies a model containing the integer number of elements.
+There are no data roles.
+\o An Object Instance specifies a model with a single Object element. The
+properties of the object are provided as roles.
+\endlist
+
+*/
diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc
index 8a50547..bb0d61a 100644
--- a/doc/src/declarative/qmlreference.qdoc
+++ b/doc/src/declarative/qmlreference.qdoc
@@ -7,8 +7,7 @@
QML is a language for building highly dynamic and fluid applications. It is targetted at the sorts of user
interface (and the sorts of hardware) in embedded devices such as phones, media
players, and set-top boxes. It is also appropriate for highly custom desktop
- user-interfaces, or special elements in more traditional desktop
- user-interfaces.
+ user interfaces, or special elements in more traditional desktop user interfaces.
Building fluid applications is done declaratively, rather than procedurally.
That is, you specify \e what the UI should look like and how it should behave
@@ -18,10 +17,10 @@
Getting Started:
\list
- \o \l {qmlexamples}{Examples}
+ \o \l {Introduction to the QML language} (in progress)
\o \l {tutorial}{Tutorial: 'Hello World'}
\o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'}
- \o \l {Introduction to the QML language} (in progress)
+ \o \l {qmlexamples}{Examples}
\endlist
Core Features:
diff --git a/doc/src/declarative/qtdeclarative.qdoc b/doc/src/declarative/qtdeclarative.qdoc
index 460819a..f94b9f8 100644
--- a/doc/src/declarative/qtdeclarative.qdoc
+++ b/doc/src/declarative/qtdeclarative.qdoc
@@ -64,6 +64,7 @@
\list
\o \l {qmlexamples}{Examples}
\o \l {tutorial}{Tutorial: 'Hello World'}
+ \o \l {advtutorial.html}{Advanced Tutorial: 'Same Game'}
\o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'}
\o \l {qmlforcpp}{QML For C++ Programmers}
\endlist
@@ -71,6 +72,7 @@
Core QML Features:
\list
\o \l {binding}{Data Binding}
+ \o \l {qmlmodels}{Data Models}
\o \l {anchor-layout}{Layout Anchors}
\o \l {qmlanimation}{Animation}
\o \l {qmlmodules}{Modules}
diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc
index 539c1d5..2ace8de 100644
--- a/doc/src/getting-started/installation.qdoc
+++ b/doc/src/getting-started/installation.qdoc
@@ -520,7 +520,7 @@ in the \l{Qt for S60 Requirements} document.
We've included a subset of the Qt demos in this package for you
to try out. An excellent starting point is the "fluidlauncher"
demo. To run the demo on a real device, you first have to install
- \c{qt_for_s60.sis} and \c{fluidlauncher.sis} found in the Qt installation
+ \c{qt.sis} and \c{fluidlauncher.sis} found in the Qt installation
directory. Begin by connecting your phone using the USB cable and
selecting "PC Suite mode". In Windows Explorer right click on the
\c{.sis} files and select "Install with Nokia Application Installer"
diff --git a/doc/src/exceptionsafety.qdoc b/doc/src/howtos/exceptionsafety.qdoc
index b70df6b..23bedf5 100644
--- a/doc/src/exceptionsafety.qdoc
+++ b/doc/src/howtos/exceptionsafety.qdoc
@@ -42,7 +42,7 @@
/*!
\page exceptionsafety.html
\title Exception Safety
- \ingroup architecture
+ \ingroup best-practices
\brief A guide to exception safety in Qt.
\bold {Preliminary warning}: Exception safety is not feature complete!
diff --git a/doc/src/s60-introduction.qdoc b/doc/src/platforms/s60-introduction.qdoc
index d0a1976..086ee52 100644
--- a/doc/src/s60-introduction.qdoc
+++ b/doc/src/platforms/s60-introduction.qdoc
@@ -121,8 +121,8 @@
\row \o \c QT_SIS_OPTIONS \o Options accepted by \c .sis creation.
-i, install the package right away using PC suite.
-c=<file>, read certificate information from a file.
- Execute \c{perl createpackage.pl} for more information
- about options.
+ Execute \c{createpackage.pl} script without any
+ parameters for more information about options.
By default no otions are given.
\row \o \c QT_SIS_TARGET \o Target for which \c .sis file is created.
Accepted values are build targets listed in
diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index 65d335b..4c3929a 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -128,6 +128,8 @@
\o Intel Compiler
\row \o Embedded Linux QWS (Mips, PowerPC)
\o gcc (\l{http:\\www.codesourcery.com}{Codesourcery version)}
+ \row \o Embedded Linux X11 (ARM)
+ \o gcc (\l{http://www.scratchbox.org/}{Scratchbox)}
\row \o Windows CE 6.0 (ARMv4i, x86, MIPS)
\o MSVC 2008 WinCE 6.0 Professional
\endtable
diff --git a/doc/src/symbian-exceptionsafety.qdoc b/doc/src/platforms/symbian-exceptionsafety.qdoc
index 88f4d03..88f4d03 100644
--- a/doc/src/symbian-exceptionsafety.qdoc
+++ b/doc/src/platforms/symbian-exceptionsafety.qdoc
diff --git a/doc/src/snippets/declarative/GroupBox.qml b/doc/src/snippets/declarative/GroupBox.qml
index 13e7eb6..6c5431e 100644
--- a/doc/src/snippets/declarative/GroupBox.qml
+++ b/doc/src/snippets/declarative/GroupBox.qml
@@ -1,12 +1,12 @@
import Qt 4.6
ContentWrapper {
- id: Container; width: parent.width; height: contents.height
+ id: container; width: parent.width; height: contents.height
children: [
Rectangle {
width: parent.width; height: contents.height
color: "white"; pen.width: 2; pen.color: "#adaeb0"; radius: 10
- VerticalLayout {
+ Column {
id: layout; width: parent.width; margin: 5; spacing: 2
Content { }
}
diff --git a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml b/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
index 6868385..3cf9ba7 100644
--- a/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
+++ b/doc/src/snippets/declarative/gridview/dummydata/ContactModel.qml
@@ -1,7 +1,7 @@
import Qt 4.6
ListModel {
- id: ContactModel
+ id: contactModel
ListElement {
name: "Bill Smith"
number: "555 3264"
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
index d0f0623..1a2021c 100644
--- a/doc/src/snippets/declarative/gridview/gridview.qml
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -11,11 +11,11 @@ Rectangle {
// instantiated for each visible item in the list.
//! [0]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 80; height: 78
- VerticalLayout {
+ Column {
Image { source: portrait; anchors.horizontalCenter: parent.horizontalCenter }
Text { text: name; anchors.horizontalCenter: parent.horizontalCenter }
}
@@ -26,7 +26,7 @@ Rectangle {
// by each ListView and placed behind the current item.
//! [1]
Component {
- id: Highlight
+ id: highlight
Rectangle {
color: "lightsteelblue"
radius: 5
@@ -37,9 +37,9 @@ Rectangle {
//! [2]
GridView {
width: parent.width; height: parent.height
- model: ContactModel; delegate: Delegate
+ model: ContactModel; delegate: delegate
cellWidth: 80; cellHeight: 80
- highlight: Highlight
+ highlight: highlight
focus: true
}
//! [2]
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
index 97eac45..2234ee7 100644
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ b/doc/src/snippets/declarative/listview/highlight.qml
@@ -11,9 +11,9 @@ Rectangle {
// instantiated for each visible item in the list.
//! [0]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 180; height: 40
Column {
x: 5; y: 5
@@ -28,22 +28,22 @@ Rectangle {
// highlight moves to the current item.
//! [1]
Component {
- id: Highlight
+ id: highlight
Rectangle {
width: 180; height: 40
color: "lightsteelblue"; radius: 5
y: SpringFollow {
- source: List.currentItem.y
+ source: list.currentItem.y
spring: 3
damping: 0.2
}
}
}
ListView {
- id: List
+ id: list
width: parent.height; height: parent.height
- model: ContactModel; delegate: Delegate
- highlight: Highlight
+ model: ContactModel; delegate: delegate
+ highlight: highlight
highlightFollowsCurrentItem: false
focus: true
}
diff --git a/doc/src/snippets/declarative/listview/listview.qml b/doc/src/snippets/declarative/listview/listview.qml
index c907077..be0f3ad 100644
--- a/doc/src/snippets/declarative/listview/listview.qml
+++ b/doc/src/snippets/declarative/listview/listview.qml
@@ -12,11 +12,11 @@ Rectangle {
// instantiated for each visible item in the list.
//! [0]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 180; height: 40
- VerticalLayout {
+ Column {
x: 5; y: 5
Text { text: '<b>Name:</b> ' + name }
Text { text: '<b>Number:</b> ' + number }
@@ -28,7 +28,7 @@ Rectangle {
// by each ListView and placed behind the current item.
//! [1]
Component {
- id: Highlight
+ id: highlight
Rectangle {
color: "lightsteelblue"
radius: 5
@@ -40,8 +40,8 @@ Rectangle {
ListView {
width: parent.width; height: parent.height
model: ContactModel
- delegate: Delegate
- highlight: Highlight
+ delegate: delegate
+ highlight: highlight
focus: true
}
//! [2]
diff --git a/doc/src/snippets/declarative/pathview/pathattributes.qml b/doc/src/snippets/declarative/pathview/pathattributes.qml
index 92d6966..19a192c 100644
--- a/doc/src/snippets/declarative/pathview/pathattributes.qml
+++ b/doc/src/snippets/declarative/pathview/pathattributes.qml
@@ -5,22 +5,22 @@ Rectangle {
//! [0]
//! [1]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 80; height: 80
scale: PathView.scale
opacity: PathView.opacity
- VerticalLayout {
- Image { anchors.horizontalCenter: Name.horizontalCenter; width: 64; height: 64; source: icon }
- Text { id: Name; text: name; font.pointSize: 16}
+ Column {
+ Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { id: name; text: name; font.pointSize: 16}
}
}
}
//! [1]
//! [2]
PathView {
- anchors.fill: parent; model: MenuModel; delegate: Delegate
+ anchors.fill: parent; model: MenuModel; delegate: delegate
path: Path {
startX: 120; startY: 100
PathAttribute { name: "scale"; value: 1.0 }
diff --git a/doc/src/snippets/declarative/pathview/pathview.qml b/doc/src/snippets/declarative/pathview/pathview.qml
index 004a1d2..5605139 100644
--- a/doc/src/snippets/declarative/pathview/pathview.qml
+++ b/doc/src/snippets/declarative/pathview/pathview.qml
@@ -5,20 +5,20 @@ Rectangle {
//! [0]
//! [1]
Component {
- id: Delegate
+ id: delegate
Item {
- id: Wrapper
+ id: wrapper
width: 80; height: 80
- VerticalLayout {
- Image { anchors.horizontalCenter: Name.horizontalCenter; width: 64; height: 64; source: icon }
- Text { id: Name; text: name; font.pointSize: 16}
+ Column {
+ Image { anchors.horizontalCenter: name.horizontalCenter; width: 64; height: 64; source: icon }
+ Text { id: name; text: name; font.pointSize: 16}
}
}
}
//! [1]
//! [2]
PathView {
- anchors.fill: parent; model: MenuModel; delegate: Delegate
+ anchors.fill: parent; model: MenuModel; delegate: delegate
path: Path {
startX: 120; startY: 100
PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
diff --git a/doc/src/snippets/statemachine/main2.cpp b/doc/src/snippets/statemachine/main2.cpp
index d882400..2419dc2 100644
--- a/doc/src/snippets/statemachine/main2.cpp
+++ b/doc/src/snippets/statemachine/main2.cpp
@@ -57,7 +57,7 @@ int main(int argv, char **args)
//![0]
//![2]
- s12>addTransition(quitButton, SIGNAL(clicked()), s12);
+ s12->addTransition(quitButton, SIGNAL(clicked()), s12);
//![2]
//![1]
@@ -71,7 +71,7 @@ int main(int argv, char **args)
QButton *interruptButton = new QPushButton("Interrupt Button");
//![3]
- QHistoryState *s1h = s1->addHistoryState();
+ QHistoryState *s1h = new QHistoryState(s1);
QState *s3 = new QState();
s3->assignProperty(label, "text", "In s3");