diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-23 12:02:52 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-02-23 12:02:52 (GMT) |
commit | de4332a4728e739b37e9c7b04c021e150e096270 (patch) | |
tree | 619aae505826654f3d89492efa53f758214fea6f /doc/src | |
parent | a419d587a666aaf55310b3a18e9f9e1993fef16e (diff) | |
parent | 3db40b0be40c946f547f238ed3f0af813892115e (diff) | |
download | Qt-de4332a4728e739b37e9c7b04c021e150e096270.zip Qt-de4332a4728e739b37e9c7b04c021e150e096270.tar.gz Qt-de4332a4728e739b37e9c7b04c021e150e096270.tar.bz2 |
Merge remote branch 'origin/master'
Conflicts:
doc/src/declarative/advtutorial1.qdoc
doc/src/declarative/tutorial2.qdoc
doc/src/declarative/tutorial3.qdoc
src/declarative/graphicsitems/qmlgraphicsmousearea.cpp
src/multimedia/playback/qmediaplayer.cpp
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/declarative/advtutorial.qdoc | 8 | ||||
-rw-r--r-- | doc/src/declarative/animation.qdoc | 4 | ||||
-rw-r--r-- | doc/src/declarative/basictypes.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/elements.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/example-slideswitch.qdoc | 6 | ||||
-rw-r--r-- | doc/src/declarative/extending-examples.qdoc | 14 | ||||
-rw-r--r-- | doc/src/declarative/extending.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/focus.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/qmldebugging.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/qmlintro.qdoc | 8 | ||||
-rw-r--r-- | doc/src/declarative/qmlmodels.qdoc | 4 | ||||
-rw-r--r-- | doc/src/declarative/qmlstates.qdoc | 2 | ||||
-rw-r--r-- | doc/src/declarative/qtbinding.qdoc | 8 | ||||
-rw-r--r-- | doc/src/declarative/scope.qdoc | 2 | ||||
-rw-r--r-- | doc/src/snippets/declarative/drag.qml | 2 | ||||
-rw-r--r-- | doc/src/snippets/declarative/mouseregion.qml | 4 |
16 files changed, 38 insertions, 34 deletions
diff --git a/doc/src/declarative/advtutorial.qdoc b/doc/src/declarative/advtutorial.qdoc index 21b20eb..b7d964c 100644 --- a/doc/src/declarative/advtutorial.qdoc +++ b/doc/src/declarative/advtutorial.qdoc @@ -51,9 +51,13 @@ how to turn that knowledge into a complete and functioning application. This tutorial involves a significant amount of JavaScript to implement the game logic. An understanding of JavaScript is helpful to understand the JavaScript parts of this tutorial, but if you don't understand JavaScript you can still get a feel for how to integrate QML elements with backend logic which creates and controls them. From the QML perspective, there is little difference between integrating with backend logic written in C++ and backend logic written in JavaScript. -In this tutorial we recreate, step by step, the Same Game demo in $QTDIR/demos/declarative/samegame.qml. +In this tutorial we recreate, step by step, a version of 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. +The Same Game demo has been extended since this tutorial was written. This tutorial only covers the version in +the $QTDIR/examples/declarative/tutorials/samegame directory. However once you have completed the tutorial you should be able +to understand the extensions in the most recent Same Game demo, and even extend it yourself. + Tutorial chapters: \list @@ -84,7 +88,7 @@ button and room to display the score. The one thing you may not recognize here is the \l 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 \l QPushButton). Since we want a fully functional button, -we use the QML elements Text and MouseRegion inside a Rectangle to assemble a +we use the QML elements Text and MouseArea inside a Rectangle to assemble a button. Below is the code which we wrote to do this: \snippet declarative/tutorials/samegame/samegame1/Button.qml 0 diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index 1acc111..d80c3fa 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -110,7 +110,7 @@ PropertyAnimation { Image { id: image source: "image.png" - MouseRegion { + MouseArea { anchors.fill: parent onPressed: animation.start() } @@ -251,7 +251,7 @@ State { \o Update x from a script \qml -MouseRegion { +MouseArea { .... onClicked: redRect.x = 24; } diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index 16e0c2e..a260812 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -294,7 +294,7 @@ Actions are used like this: \qml - MouseRegion { onClicked: MyItem.myaction.trigger() } + MouseArea { onClicked: MyItem.myaction.trigger() } State { name: "enabled"; when: MyItem.myaction.enabled == true } Text { text: MyItem.someaction.text } \endqml diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index e8fb1e7..682a2ac 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -126,7 +126,7 @@ The following table lists the QML elements provided by the Qt Declarative module \o \list -\o \l MouseRegion +\o \l MouseArea \o \l FocusScope \endlist diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc index 79b362e..d1b1066 100644 --- a/doc/src/declarative/example-slideswitch.qdoc +++ b/doc/src/declarative/example-slideswitch.qdoc @@ -84,15 +84,15 @@ the text will only be visible when the switch is on. \snippet examples/declarative/slideswitch/content/Switch.qml 4 First, we create the background image of the switch. -In order for the switch to toggle when the user clicks on the background, we add a \l{MouseRegion} as a child item of the image. -A \c MouseRegion has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a +In order for the switch to toggle when the user clicks on the background, we add a \l{MouseArea} as a child item of the image. +A \c MouseArea has a \c onClicked property that is triggered when the item is clicked. For the moment we will just call a \c toggle() function. We will see what this function does in a moment. \snippet examples/declarative/slideswitch/content/Switch.qml 5 Then, we place the image of the knob on top of the background. The interaction here is a little more complex. We want the knob to move with the finger when it is clicked. That is what the \c drag -property of the \c MouseRegion is for. We also want to toggle the switch if the knob is released between state. We handle this case +property of the \c MouseArea is for. We also want to toggle the switch if the knob is released between state. We handle this case in the \c dorelease() function that is called in the \c onReleased property. \section2 States diff --git a/doc/src/declarative/extending-examples.qdoc b/doc/src/declarative/extending-examples.qdoc index c569ee0..b84ae0e 100644 --- a/doc/src/declarative/extending-examples.qdoc +++ b/doc/src/declarative/extending-examples.qdoc @@ -105,15 +105,15 @@ The BirthdayParty class is declared like this: \snippet examples/declarative/extending/properties/birthdayparty.h 3 The class contains a member to store the celebrant object, and also a -QmlConcreteList<Person *> member. +QList<Person *> member. In QML, the type of a list properties - and the guests property is a list of -people - are all of type QmlList<T *>*. QmlList is an abstract list interface -that allows a developer to react to QML accessing and modifying the contents of -the list. This is useful for implementing "virtual lists" or other advanced -scenarios, but can't be used directly for the common case of just wanting a -regular list of things. For this a concrete implementation, QmlConcreteList, is -provided and that is used here. +people - are all of type QmlListProperty<T>. QmlListProperty is simple value +type that contains a set of function pointers. QML calls these function +pointers whenever it needs to read from, write to or otherwise interact with +the list. In addition to concrete lists like the people list used in this +example, the use of QmlListProperty allows for "virtual lists" and other advanced +scenarios. \section2 Define the BirthdayParty diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index e9a7803..0456f3f 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -169,7 +169,7 @@ for assignment to appropriately typed properties. The guests property is a list of \c Person objects. Properties that are lists of objects or Qt interfaces are also declared with the Q_PROPERTY() macro, just -like other properties. List properties must have the type \c {QmlList<T *>*}. +like other properties. List properties must have the type \c {QmlListProperty<T>}. As with object properties, the type \a T must be registered with QML. The guest property declaration looks like this: diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index bfbb6af..6459a2e 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -263,7 +263,7 @@ Rectangle { FocusScope { id: page; width: 240; height: 25 MyWidget { focus: true } - MouseRegion { anchors.fill: parent; onClicked: { page.focus = true } } + MouseArea { anchors.fill: parent; onClicked: { page.focus = true } } } \endcode \endtable diff --git a/doc/src/declarative/qmldebugging.qdoc b/doc/src/declarative/qmldebugging.qdoc index c11ff1f..56bd7d2 100644 --- a/doc/src/declarative/qmldebugging.qdoc +++ b/doc/src/declarative/qmldebugging.qdoc @@ -50,7 +50,7 @@ \qml Rectangle { width: 200; height: 200 - MouseRegion { + MouseArea { anchors.fill: parent onClicked: console.log("clicked") } diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc index 11a286f..b353e44 100644 --- a/doc/src/declarative/qmlintro.qdoc +++ b/doc/src/declarative/qmlintro.qdoc @@ -326,11 +326,11 @@ Item { \section2 Signal Handlers Signal handlers allow actions to be taken in reponse to an event. For instance, -the \l MouseRegion element has signal handlers to handle mouse press, release +the \l MouseArea element has signal handlers to handle mouse press, release and click: \code -MouseRegion { +MouseArea { onPressed: console.log("mouse button pressed") } \endcode @@ -338,10 +338,10 @@ MouseRegion { All signal handlers begin with \e "on". Some signal handlers include an optional parameter, for example -the MouseRegion onPressed signal handler has a \e mouse parameter: +the MouseArea onPressed signal handler has a \e mouse parameter: \code -MouseRegion { +MouseArea { acceptedButtons: Qt.LeftButton | Qt.RightButton onPressed: if (mouse.button == Qt.RightButton) console.log("Right mouse button pressed") } diff --git a/doc/src/declarative/qmlmodels.qdoc b/doc/src/declarative/qmlmodels.qdoc index 39a09bd..4843a7b 100644 --- a/doc/src/declarative/qmlmodels.qdoc +++ b/doc/src/declarative/qmlmodels.qdoc @@ -223,7 +223,7 @@ ListView { anchors.fill: parent model: myModel delegate: Component { - Rect { + Rectangle { height: 25 Text { text: modelData } } @@ -258,7 +258,7 @@ dataList.append(new DataObject("Item 3", "blue")); dataList.append(new DataObject("Item 4", "yellow")); QmlContext *ctxt = view.rootContext(); -ctxt->setContextProperty("myModel", QVariant::fromValue(&dataList)); +ctxt->setContextProperty("myModel", QVariant::fromValue(dataList)); \endcode The properties of the object may then be accessed in the delegate: diff --git a/doc/src/declarative/qmlstates.qdoc b/doc/src/declarative/qmlstates.qdoc index 36a2479..2118c2b 100644 --- a/doc/src/declarative/qmlstates.qdoc +++ b/doc/src/declarative/qmlstates.qdoc @@ -94,7 +94,7 @@ Item { } ] - MouseRegion { + MouseArea { anchors.fill: parent onClicked: myItem.state = 'moved' } diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc index 7857d48..732ff86 100644 --- a/doc/src/declarative/qtbinding.qdoc +++ b/doc/src/declarative/qtbinding.qdoc @@ -212,7 +212,7 @@ Rectangle { text: "Hello Colorful World!" } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: { palette.text = "blue"; @@ -255,7 +255,7 @@ the following types: \o QVariant \endlist -This example toggles the "LED Blinker" when the MouseRegion is clicked: +This example toggles the "LED Blinker" when the MouseArea is clicked: \table \row @@ -291,7 +291,7 @@ int main(int argc, char **argv) import Qt 4.6 Rectangle { - MouseRegion { + MouseArea { anchors.fill: parent onClicked: { if (ledBlinker.isRunning()) @@ -315,7 +315,7 @@ is to have a "running" property. This leads to much nicer QML code: import Qt 4.6 Rectangle { - MouseRegion { + MouseArea { anchors.fill: parent onClicked: ledBlinker.running = !ledBlinker.running } diff --git a/doc/src/declarative/scope.qdoc b/doc/src/declarative/scope.qdoc index 5486afd..f709335 100644 --- a/doc/src/declarative/scope.qdoc +++ b/doc/src/declarative/scope.qdoc @@ -317,7 +317,7 @@ Rectangle { anchors.centerIn: parent text: root.text } - MouseRegion { + MouseArea { anchors.fill: parent onClicked: buttonClicked(text) } diff --git a/doc/src/snippets/declarative/drag.qml b/doc/src/snippets/declarative/drag.qml index 8735d0c..8e5b599 100644 --- a/doc/src/snippets/declarative/drag.qml +++ b/doc/src/snippets/declarative/drag.qml @@ -6,7 +6,7 @@ Rectangle { Image { id: pic; source: "qtlogo-64.png"; anchors.verticalCenter: parent.verticalCenter opacity: (600.0-pic.x) / 600; - MouseRegion { + MouseArea { anchors.fill: parent drag.target: pic drag.axis: "XAxis" diff --git a/doc/src/snippets/declarative/mouseregion.qml b/doc/src/snippets/declarative/mouseregion.qml index 67857f5..79f8f8f 100644 --- a/doc/src/snippets/declarative/mouseregion.qml +++ b/doc/src/snippets/declarative/mouseregion.qml @@ -4,13 +4,13 @@ Rectangle { width: 200; height: 100 HorizontalLayout { //! [0] Rectangle { width: 100; height: 100; color: "green" - MouseRegion { anchors.fill: parent; onClicked: { parent.color = 'red' } } + MouseArea { anchors.fill: parent; onClicked: { parent.color = 'red' } } } //! [0] //! [1] Rectangle { width: 100; height: 100; color: "green" - MouseRegion { + MouseArea { anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton onClicked: { |