Qt Reference Documentation

QML ScriptAction Element

The ScriptAction element allows scripts to be run during an animation. More...

Inherits Animation

  • List of all members, including inherited members
  • Properties

    Detailed Description

    ScriptAction can be used to run script at a specific point in an animation.

     SequentialAnimation {
         NumberAnimation { ... }
         ScriptAction { script: doSomething(); }
         NumberAnimation { ... }

    When used as part of a Transition, you can also target a specific StateChangeScript to run using the scriptName property.

     State {
         StateChangeScript {
             name: "myScript"
             script: doStateStuff();
     Transition {
         SequentialAnimation {
             NumberAnimation { ... }
             ScriptAction { scriptName: "myScript" }
             NumberAnimation { ... }

    See also StateChangeScript.

    Property Documentation

    script : script

    This property holds the script to run.

    scriptName : string

    This property holds the the name of the StateChangeScript to run.

    This property is only valid when ScriptAction is used as part of a transition. If both script and scriptName are set, scriptName will be used.

    Note: When using scriptName in a reversible transition, the script will only be run when the transition is being run forwards.


    Thank you for giving your feedback.

    Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

    [0]; s.parentNode.insertBefore(ga, s); })();