In questa pagina

ScriptAction QML Type

Definisce gli script da eseguire durante un'animazione. Maggiori informazioni...

Import Statement: import QtQuick
Inherits:

Animation

Proprietà

Descrizione dettagliata

ScriptAction può essere utilizzato per eseguire uno script in un punto specifico di un'animazione.

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

Se utilizzato come parte di una transizione, è anche possibile specificare un'StateChangeScript e da eseguire utilizzando la proprietà scriptName.

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

Vedi anche StateChangeScript.

Documentazione delle proprietà

script : script

Questa proprietà contiene lo script da eseguire.

scriptName : string

Questa proprietà contiene il nome dello script “ StateChangeScript ” da eseguire.

Questa proprietà è valida solo quando ScriptAction viene utilizzato come parte di una transizione. Se sono impostati sia script che scriptName, verrà utilizzato scriptName.

Nota: quando si utilizza scriptName in una transizione reversibile, lo script verrà eseguito solo quando la transizione viene eseguita in avanti.

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