ScriptAction QML Type
Définit les scripts à exécuter pendant une animation. Plus d'informations...
| Import Statement: | import QtQuick |
| Inherits: |
Propriétés
- script : script
- scriptName : string
Description détaillée
ScriptAction peut être utilisé pour exécuter un script à un moment précis d'une animation.
SequentialAnimation { NumberAnimation { // ... } ScriptAction { script: doSomething(); } NumberAnimation { // ... } }
Lorsqu'elle est utilisée dans le cadre d'une transition, vous pouvez également cibler un site 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 aussi 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 du site 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 n'est exécuté que lorsque la transition est exécutée vers l'avant.
© 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.