diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-24 02:08:42 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-24 02:08:42 (GMT) |
commit | b879188477238a26c57a97abbe1f87a6348a5b6a (patch) | |
tree | 0630bcf787b3b66a774d24fe101469fdde5eafc9 | |
parent | ef7e4d6b0b1e8ab65201b0464e3fa473b505f833 (diff) | |
parent | c19a55e55996851325cb0ad421af5dc2e8e9164a (diff) | |
download | Qt-b879188477238a26c57a97abbe1f87a6348a5b6a.zip Qt-b879188477238a26c57a97abbe1f87a6348a5b6a.tar.gz Qt-b879188477238a26c57a97abbe1f87a6348a5b6a.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | doc/src/declarative/advtutorial1.qdoc | 1 | ||||
-rw-r--r-- | doc/src/declarative/advtutorial2.qdoc | 1 | ||||
-rw-r--r-- | doc/src/declarative/advtutorial3.qdoc | 1 | ||||
-rw-r--r-- | doc/src/declarative/advtutorial4.qdoc | 1 | ||||
-rw-r--r-- | doc/src/declarative/animation.qdoc | 6 | ||||
-rw-r--r-- | doc/src/declarative/qmlintro.qdoc | 24 | ||||
-rw-r--r-- | doc/src/declarative/qmlreference.qdoc | 16 | ||||
-rw-r--r-- | doc/src/declarative/qmlstates.qdoc | 4 | ||||
-rw-r--r-- | doc/src/declarative/qmlviewer.qdoc | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlpropertychanges.cpp | 17 | ||||
-rw-r--r-- | src/declarative/util/qmlstateoperations.cpp | 21 |
11 files changed, 73 insertions, 21 deletions
diff --git a/doc/src/declarative/advtutorial1.qdoc b/doc/src/declarative/advtutorial1.qdoc index a96485c..86d14ad 100644 --- a/doc/src/declarative/advtutorial1.qdoc +++ b/doc/src/declarative/advtutorial1.qdoc @@ -41,7 +41,6 @@ /*! \page advtutorial1.html -\example declarative/tutorials/samegame/samegame1 \title Advanced Tutorial 1 - Creating the Game Canvas and Blocks 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. diff --git a/doc/src/declarative/advtutorial2.qdoc b/doc/src/declarative/advtutorial2.qdoc index 9fab289..40a760d 100644 --- a/doc/src/declarative/advtutorial2.qdoc +++ b/doc/src/declarative/advtutorial2.qdoc @@ -41,7 +41,6 @@ /*! \page advtutorial2.html -\example declarative/tutorials/samegame/samegame2 \title Advanced Tutorial 2 - Populating the Game Canvas Now that we've written some basic elements, let's start writing the game. The diff --git a/doc/src/declarative/advtutorial3.qdoc b/doc/src/declarative/advtutorial3.qdoc index 5ac1be3..e6e4e97 100644 --- a/doc/src/declarative/advtutorial3.qdoc +++ b/doc/src/declarative/advtutorial3.qdoc @@ -41,7 +41,6 @@ /*! \page advtutorial3.html -\example declarative/tutorials/samegame/samegame3 \title Advanced Tutorial 3 - Implementing the Game Logic First we add to the \c initBoard function clearing of the board before filling it up again, so that clicking new game won't leave the previous game diff --git a/doc/src/declarative/advtutorial4.qdoc b/doc/src/declarative/advtutorial4.qdoc index 2599e32..aaa7293 100644 --- a/doc/src/declarative/advtutorial4.qdoc +++ b/doc/src/declarative/advtutorial4.qdoc @@ -41,7 +41,6 @@ /*! \page advtutorial4.html -\example declarative/tutorials/samegame/samegame4 \title Advanced Tutorial 4 - Finishing Touches Now we're going to do two things to liven the game up. Animate the blocks and add a web-based high score system. diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index 1314493..d05a444 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -186,7 +186,7 @@ Transition { } \endcode -To insert an explicit animation into your transition, you can use \target and \property as normal. +To insert an explicit animation into your transition, you can use \c target and \c property as normal. \code Transition { @@ -214,8 +214,8 @@ Transition { \section1 Property Behaviors -A property behavior specifies a default animation to run whenever the property's value changes, regardless -of what caused the change. Unlike Transition, Behavior doesn't provide a way to indicate that a Behavior +A \l{Behavior}{property behavior} specifies a default animation to run whenever the property's value changes, regardless +of what caused the change. Unlike Transition, \l Behavior doesn't provide a way to indicate that a Behavior should only apply under certain circumstances. In the following snippet, we specify that we want the x position of redRect to be animated diff --git a/doc/src/declarative/qmlintro.qdoc b/doc/src/declarative/qmlintro.qdoc index f84d614..ab9416b 100644 --- a/doc/src/declarative/qmlintro.qdoc +++ b/doc/src/declarative/qmlintro.qdoc @@ -239,8 +239,8 @@ Image { \section2 Default properties -Each object type can specify one of its list properties as its default property. -If a list property has been declared as the default property, the property tag can be omitted. +Each object type can specify one of its list or object properties as its default property. +If a property has been declared as the default property, the property tag can be omitted. For example this code: \code @@ -263,9 +263,27 @@ State { because \c changes is the default property of the \c State type. -\section2 Dot Properties +\section2 Grouped Properties +In some cases properties form a logical group and use a 'dot' or grouped notation +to show this. +Grouped properties can be written like this: +\qml +Text { + font.pixelSize: 12 + font.bold: true +} +\endqml + +or like this: +\qml +Text { + font { pixelSize: 12; bold: true } +} +\endqml + +In the element documentation grouped properties are shown using the 'dot' notation. \section2 Attached Properties \target attached-properties diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc index f17e9d7..2c79aeb 100644 --- a/doc/src/declarative/qmlreference.qdoc +++ b/doc/src/declarative/qmlreference.qdoc @@ -45,16 +45,22 @@ \target qtdeclarativemainpage - 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 + QML is a language for building the animation rich, + highly fluid user interfaces that are becoming common in portable consumer + electronics devices such as mobile phones, media players, set-top boxes and + netbooks. It is also appropriate for highly custom desktop 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 rather than specifying step-by-step \e how to build it. Specifying a UI declaratively does not just include the layout of the interface items, but also the way each - individual item looks and behaves and the overall flow of the application. + individual item looks and behaves and the overall flow of the application. + + The QML elements provide a sophisticated set of graphical and behavioral building + blocks. These different elements are combined together in \l {QML Documents}{QML documents} to build components + ranging in complexity from simple buttons and sliders, to complete + internet-enabled applications like a \l {http://www.flickr.com}{Flickr} photo browser. Getting Started: \list @@ -69,6 +75,7 @@ \o \l {QML Documents} \o \l {Property Binding} \o \l {ECMAScript Blocks} + \o \l {QML Scope} \o \l {Network Transparency} \o \l {qmlmodels}{Data Models} \o \l {anchor-layout}{Anchor-based Layout} @@ -82,5 +89,6 @@ QML Reference: \list \o \l {elements}{QML Elements} + \o \l {QML Global Object} \endlist */ diff --git a/doc/src/declarative/qmlstates.qdoc b/doc/src/declarative/qmlstates.qdoc index 261e3f5..ddb0fc8 100644 --- a/doc/src/declarative/qmlstates.qdoc +++ b/doc/src/declarative/qmlstates.qdoc @@ -3,7 +3,7 @@ \target qmlstates \title QML States -QML states describe user interface configurations, including: +QML states typically describe user interface configurations, including: \list \o What UI elements are present \o The properties of those elements (including how they behave) @@ -52,7 +52,7 @@ To animate state changes, you can use \l{state-transitions}{transitions}. Other things you can do in a state change: \list \o override signal handlers with PropertyChanges -\o change an item's parent with ParentChange +\o change an item's visual parent with ParentChange \o change an item's anchors with AnchorChanges \o run some script with StateChangeScript \endlist diff --git a/doc/src/declarative/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc index f153df2..df96535 100644 --- a/doc/src/declarative/qmlviewer.qdoc +++ b/doc/src/declarative/qmlviewer.qdoc @@ -71,7 +71,7 @@ that is a qreal from 0 to 86400 representing the number of seconds since midnight, dummy data for this could be provided by \c dummydata/clock.qml: \code - Object { property real time: 12345 } + QtObject { property real time: 12345 } \endcode Any QML can be used in the dummy data files. You could even animate the fictional data! diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp index 28c8e4f..6a393ee 100644 --- a/src/declarative/util/qmlpropertychanges.cpp +++ b/src/declarative/util/qmlpropertychanges.cpp @@ -57,7 +57,8 @@ QT_BEGIN_NAMESPACE \brief The PropertyChanges element describes new property values for a state. PropertyChanges changes the properties of an item. It allows you to specify the property - names and values similar to how you normally would specify them for the actual item: + names and values for a state similar to how you normally would specify them for the + actual item: \code PropertyChanges { @@ -67,6 +68,20 @@ QT_BEGIN_NAMESPACE width: 48 } \endcode + + State-specific script for signal handlers can also be specified: + + \qml + PropertyChanges { + target: myMouseRegion + onClicked: doSomethingDifferent() + } + \endqml + + Changes to an Item's parent or anchors should be done using the associated change elements + (ParentChange and AnchorChanges, respectively) rather than PropertyChanges. + + \sa {qmlstate}{States} */ /*! diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index e2933b2..9727ca7 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -153,6 +153,9 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics More specifically, it will not work if the transform property has been set for any Items involved in the reparenting (defined as any Items in the common ancestor tree for the original and new parent). + + You can specify at which point in a transition you want a ParentChange to occur by + using a ParentAction. */ QML_DEFINE_TYPE(Qt,4,6,ParentChange,QmlParentChange) @@ -166,7 +169,7 @@ QmlParentChange::~QmlParentChange() } /*! - \qmlproperty Object ParentChange::target + \qmlproperty Item ParentChange::target This property holds the item to be reparented */ @@ -310,6 +313,10 @@ public: /*! \qmlclass StateChangeScript QmlStateChangeScript \brief The StateChangeScript element allows you to run a script in a state. + + The script specified will be run immediately when the state is made current. + Alternatively you can use a ScriptAction to specify at which point in the transition + you want the StateChangeScript to be run. */ QML_DEFINE_TYPE(Qt,4,6,StateChangeScript,QmlStateChangeScript) QmlStateChangeScript::QmlStateChangeScript(QObject *parent) @@ -385,8 +392,16 @@ QString QmlStateChangeScript::typeName() const \qmlclass AnchorChanges QmlAnchorChanges \brief The AnchorChanges element allows you to change the anchors of an item in a state. + In the following example we change the top and bottom anchors of an item: \snippet examples/declarative/anchors/anchor-changes.qml 0 + AnchorChanges will 'inject' \c x, \c y, \c width, and \c height changes into the transition, + so you can animate them as you would normally changes to these properties: + \qml + //animate our anchor changes + NumberAnimation { matchTargets: content; matchProperties: "x,y,width,height" } + \endqml + For more information on anchors see \l {anchor-layout}{Anchor Layouts}. */ @@ -432,8 +447,8 @@ public: }; /*! - \qmlproperty Object AnchorChanges::target - This property holds the object that the anchors to change belong to + \qmlproperty Item AnchorChanges::target + This property holds the Item whose anchors will change */ QmlAnchorChanges::QmlAnchorChanges(QObject *parent) |