summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativestategroup.cpp
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2011-02-24 16:07:22 (GMT)
committeraxis <qt-info@nokia.com>2011-02-24 16:07:22 (GMT)
commit2b768ad7d4de4862584762a7d106d9cfcc3416df (patch)
tree0ddfe84f345d7e61ce71daa51fbbfb373c3e3106 /src/declarative/util/qdeclarativestategroup.cpp
parentbb7d9bcc8e0c617091e91f7a40f3d33f8c1cdec1 (diff)
parentca7be48b7a150952a9657d1000941fb986e5bb2b (diff)
downloadQt-2b768ad7d4de4862584762a7d106d9cfcc3416df.zip
Qt-2b768ad7d4de4862584762a7d106d9cfcc3416df.tar.gz
Qt-2b768ad7d4de4862584762a7d106d9cfcc3416df.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt into earth-master
Conflicts: src/network/access/qnetworkreplyimpl.cpp tests/auto/moc/tst_moc.cpp
Diffstat (limited to 'src/declarative/util/qdeclarativestategroup.cpp')
-rw-r--r--src/declarative/util/qdeclarativestategroup.cpp48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/declarative/util/qdeclarativestategroup.cpp b/src/declarative/util/qdeclarativestategroup.cpp
index 7aeea12..f1d0997 100644
--- a/src/declarative/util/qdeclarativestategroup.cpp
+++ b/src/declarative/util/qdeclarativestategroup.cpp
@@ -102,10 +102,10 @@ public:
id: myStateGroup
states: State {
name: "state1"
- ...
+ // ...
}
transitions: Transition {
- ...
+ // ...
}
}
@@ -140,11 +140,15 @@ QList<QDeclarativeState *> QDeclarativeStateGroup::states() const
\qml
StateGroup {
- states: [
- State { ... },
- State { ... }
- ...
- ]
+ states: [
+ State {
+ // State definition...
+ },
+ State {
+ // ...
+ }
+ // Other states...
+ ]
}
\endqml
@@ -197,11 +201,15 @@ void QDeclarativeStateGroupPrivate::clear_states(QDeclarativeListProperty<QDecla
\qml
StateGroup {
- transitions: [
- Transition { ... },
- Transition { ... }
- ...
- ]
+ transitions: [
+ Transition {
+ // ...
+ },
+ Transition {
+ // ...
+ }
+ // ...
+ ]
}
\endqml
@@ -221,14 +229,14 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeStateGroup::transit
This property is often used in scripts to change between states. For
example:
- \qml
- function toggle() {
- if (button.state == 'On')
- button.state = 'Off';
- else
- button.state = 'On';
- }
- \endqml
+ \js
+ function toggle() {
+ if (button.state == 'On')
+ button.state = 'Off';
+ else
+ button.state = 'On';
+ }
+ \endjs
If the state group is in its base state (i.e. no explicit state has been
set), \c state will be a blank string. Likewise, you can return a