ScriptAction QML Type

애니메이션 중에 실행할 스크립트를 정의합니다. 더 보기...

Import Statement: import QtQuick
Inherits:

Animation

속성

상세 설명

스크립트 액션은 애니메이션의 특정 지점에서 스크립트를 실행하는 데 사용할 수 있습니다.

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

트랜지션의 일부로 사용하는 경우 scriptName 속성을 사용하여 특정 StateChangeScript 을 실행하도록 지정할 수도 있습니다.

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

StateChangeScript참조하세요 .

속성 문서

script : script

이 프로퍼티에는 실행할 스크립트가 저장됩니다.


scriptName : string

이 속성에는 실행할 StateChangeScript 의 이름이 저장됩니다.

이 속성은 ScriptAction 이 전환의 일부로 사용되는 경우에만 유효합니다. 스크립트와 스크립트 이름이 모두 설정되어 있으면 스크립트 이름이 사용됩니다.

참고: 리버시블 전환에서 scriptName을 사용하는 경우 스크립트는 전환이 정방향으로 실행될 때만 실행됩니다.


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