Auf dieser Seite

ScriptAction QML Type

Definiert Skripte, die während einer Animation ausgeführt werden sollen. Mehr...

Import Statement: import QtQuick
Inherits:

Animation

Eigenschaften

Ausführliche Beschreibung

Mit „ScriptAction“ kann ein Skript an einer bestimmten Stelle in einer Animation ausgeführt werden.

SequentialAnimation {
    NumberAnimation {
        // ...
    }
    ScriptAction { script: doSomething(); }
    NumberAnimation {
        // ...
    }
}

Bei Verwendung als Teil eines Übergangs können Sie mithilfe der Eigenschaft „ scriptName “ auch ein bestimmtes „ StateChangeScript “ zum Ausführen auswählen.

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

Siehe auch „ StateChangeScript “.

Eigenschaftsdokumentation

script : script

Diese Eigenschaft enthält das auszuführende Skript.

scriptName : string

Diese Eigenschaft enthält den Namen der auszuführenden „ StateChangeScript “.

Diese Eigenschaft ist nur gültig, wenn „ ScriptAction “ als Teil eines Übergangs verwendet wird. Sind sowohl „script“ als auch „scriptName“ festgelegt, wird „scriptName“ verwendet.

Hinweis: Bei Verwendung von „scriptName“ in einem reversiblen Übergang wird das Skript nur ausgeführt, wenn der Übergang vorwärts abläuft.

© 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.