[Qt-qml] StateChangeScript - why do we have it?

Ville M. Vainio vivainio at gmail.com
Sun Dec 26 20:18:36 CET 2010


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?

-- 
Ville M. Vainio @@ Forum Nokia


More information about the Qt-qml mailing list