Hi, On Mon, Dec 27, 2010 at 12:48 AM, Ville M. Vainio <[email protected]> wrote: > StateChangeScript executes a script when you enter a State: > > State { > name "state1" > StateChangeScript { > name: "myScript" > script: doStateStuff(); > } > ... > } > > To a naive observer, it would seem more elegant to have the State emit > a signal when you enter it: > > State { > name "state1" > > onEntered: { > doStateStuff(); > } > ... > } > > I guess there is a good rationale for this that evades plain sight? >
When you have multiple changes in a state, you can control when the script gets executed in a transition using ScriptAction. For example, if you have 3 PropertyChange and a StateChangeScript, you can have the script execute after 2 PropertyChanges. With something like onEntered, the script would always have to run at the beginning of the transition. Girish _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
