指定如何按状态运行脚本 更多...
import 语句: | import QtQuick 2.7 |
A StateChangeScript is run upon entering a state. You can optionally use ScriptAction to specify the point in the transition at which the StateChangeScript should be run.
State { name: "state1" StateChangeScript { name: "myScript" script: doStateStuff(); } // ... } // ... Transition { to: "state1" SequentialAnimation { NumberAnimation { /* ... */ } ScriptAction { scriptName: "myScript" } NumberAnimation { /* ... */ } } }
另请参阅 ScriptAction .
This property holds the name of the script. This name can be used by a ScriptAction to target a specific script.
另请参阅 ScriptAction::scriptName .
script : script |
This property holds the script to run when the state is current.