diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-24 05:44:09 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-24 06:10:32 (GMT) |
commit | 17c88fb432574e876e3d72c17d5453dccc351e9c (patch) | |
tree | 2dd666a7557c0bc74d62f61649235a0a7a2e915e /src/declarative/util/qdeclarativestateoperations.cpp | |
parent | e3563de2f453697e8640db507ea039166c0b5dc8 (diff) | |
download | Qt-17c88fb432574e876e3d72c17d5453dccc351e9c.zip Qt-17c88fb432574e876e3d72c17d5453dccc351e9c.tar.gz Qt-17c88fb432574e876e3d72c17d5453dccc351e9c.tar.bz2 |
StateChangeScript doc.
Diffstat (limited to 'src/declarative/util/qdeclarativestateoperations.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativestateoperations.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 163d220..0bc81ee 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -494,9 +494,31 @@ public: \qmlclass StateChangeScript QDeclarativeStateChangeScript \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 + StateChangeScripts are run when entering the state. You can use + ScriptAction to specify at which point in the transition you want the StateChangeScript to be run. + + \qml + State { + name "state1" + StateChangeScript { + name: "myScript" + script: doStateStuff(); + } + ... + } + ... + Transition { + to: "state1" + SequentialAnimation { + NumberAnimation { ... } + ScriptAction { scriptName: "myScript" } + NumberAnimation { ... } + } + } + \endqml + + \sa ScriptAction */ QDeclarativeStateChangeScript::QDeclarativeStateChangeScript(QObject *parent) |