IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

ScriptAction QML Type

Defines scripts to be run during an animation.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

ScriptAction QML Type

  • Import Statement: import QtQuick

  • Inherits:: Animation

  • Group: ScriptAction is part of qtquick-transitions-animations

Detailed Description

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

 
Sélectionnez
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.

 
Sélectionnez
State {
    name: "state1"
    StateChangeScript {
        name: "myScript"
        script: doStateStuff();
    }
    // ...
}
// ...
Transition {
    to: "state1"
    SequentialAnimation {
        NumberAnimation { /* ... */ }
        ScriptAction { scriptName: "myScript" }
        NumberAnimation { /* ... */ }
    }
}

See Also

Property Documentation

 

script : script

This property holds the script to run.

scriptName : string

This property holds 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.

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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+