StateChangeScript Element Reference

The StateChangeScript element allows you to run a script in a state.

Detailed Description

The StateChangeScript element allows you to run a script in a state.

A StateChangeScript is run upon entering a state. You can optionally use ScriptAction to specify the point in the transition at which the StateChangeScript should to be run.

  1.                 State  {
  2.     name: "state1"
  3.     StateChangeScript  {
  4.         name: "myScript"
  5.         script: doStateStuff();
  6.     }
  7.     // ...
  8. }
  9. // ...
  10. Transition  {
  11.     to: "state1"
  12.     SequentialAnimation  {
  13.         NumberAnimation  { /* ... */ }
  14.         ScriptAction  { scriptName: "myScript" }
  15.         NumberAnimation  { /* ... */ }
  16.     }
  17. }

Properties

Property Documentation

This property holds the name of the script. This name can be used by a ScriptAction to target a specific script.

See also ScriptAction::scriptName.

This property holds the script to run when the state is current.

Notes provided by the Qt Community

No notes