StateGroup QML Type

항목이 아닌 유형에 대한 기본 제공 상태 지원을 제공합니다. 더 보기...

Import Statement: import QtQuick

속성

상세 설명

Item(및 모든 파생 유형)은 state, statestransitions 속성을 통해 상태 및 전환에 대한 기본 지원을 제공합니다. StateGroup은 다른 (Item에서 파생되지 않은) 유형에서 이 지원을 쉽게 사용할 수 있는 방법을 제공합니다.

MyCustomObject {
    StateGroup {
        id: myStateGroup
        states: State {
            name: "state1"
            // ...
        }
        transitions: Transition {
            // ...
        }
    }

    onSomethingHappened: myStateGroup.state = "state1";
}

Qt Quick 상태, 트랜지션Qt Qml.

속성 문서

state : string

이 속성은 상태 그룹의 현재 상태 이름을 보유합니다.

이 속성은 스크립트에서 상태 간에 변경하는 데 자주 사용됩니다. 예를 들어

function toggle() {
    if (button.state == 'On')
        button.state = 'Off';
    else
        button.state = 'On';
}

상태 그룹이 기본 상태인 경우(즉, 명시적인 상태가 설정되지 않은 경우) state 은 빈 문자열이 됩니다. 마찬가지로 상태 그룹의 현재 상태를 '' 으로 설정하여 상태 그룹을 기본 상태로 되돌릴 수 있습니다.

Qt Quick 상태도참조하세요 .


states : list<State> [read-only]

이 속성은 상태 그룹에 정의된 상태 목록을 보유합니다.

StateGroup {
    states: [
        State {
            // State definition...
        },
        State {
            // ...
        }
        // Other states...
    ]
}

Qt Quick 상태도참조하세요 .


transitions : list<Transition> [read-only]

이 속성은 상태 그룹에 의해 정의된 전환 목록을 보유합니다.

StateGroup {
    transitions: [
        Transition {
          // ...
        },
        Transition {
          // ...
        }
        // ...
    ]
}

트랜지션도참조하십시오 .


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