ScriptAction QML Type
Définit les scripts à exécuter pendant une animation. En savoir plus...
| Import Statement: | import QtQuick |
| Inherits: |
Propriétés
- script : script
- scriptName : string
Description détaillée
ScriptAction permet d'exécuter un script à un moment précis d'une animation.
SequentialAnimation {
NumberAnimation {
// ...
}
ScriptAction { script: doSomething(); }
NumberAnimation {
// ...
}
}Lorsqu’il est utilisé dans le cadre d’une transition, vous pouvez également cibler une « StateChangeScript » spécifique à exécuter à l’aide de la propriété « scriptName ».
State {
name: "state1"
StateChangeScript {
name: "myScript"
script: doStateStuff();
}
// ...
}
// ...
Transition {
to: "state1"
SequentialAnimation {
NumberAnimation { /* ... */ }
ScriptAction { scriptName: "myScript" }
NumberAnimation { /* ... */ }
}
}Voir également StateChangeScript.
Documentation sur les propriétés
script : script
Cette propriété contient le script à exécuter.
scriptName : string
Cette propriété contient le nom de l'StateChangeScript à exécuter.
Cette propriété n'est valable que lorsque « ScriptAction » est utilisé dans le cadre d'une transition. Si « script » et « scriptName » sont tous deux définis, c'est « scriptName » qui sera utilisé.
Remarque : lorsque vous utilisez « scriptName » dans une transition réversible, le script ne sera exécuté que lorsque la transition s'effectue dans le sens direct.
© 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.