이 페이지에서

ScriptAction QML Type

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

Import Statement: import QtQuick
Inherits:

Animation

속성

상세 설명

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

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

전환(Transition)의 일부로 사용할 경우, 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 가 전환의 일부로 사용될 때만 유효합니다. script와 scriptName이 모두 설정된 경우, scriptName이 사용됩니다.

참고: 되돌릴 수 있는 전환에서 scriptName을 사용할경우 , 스크립트는 전환이 정방향으로 실행될 때만 실행됩니다.

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