Sur cette page

StateChangeScript QML Type

Spécifie comment exécuter un script dans un état. Plus d'informations...

Import Statement: import QtQuick

Propriétés

Description détaillée

Un StateChangeScript est exécuté lors de l'entrée dans un état. Vous pouvez éventuellement utiliser ScriptAction pour spécifier le point de la transition auquel le StateChangeScript doit être exécuté.

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

Voir également ScriptAction.

Documentation sur les propriétés

name : string

Cette propriété contient le nom du script. Ce nom peut être utilisé par ScriptAction pour cibler un script spécifique.

Voir également ScriptAction::scriptName.

script : script

Cette propriété contient le script à exécuter lorsque l'état est courant.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.