State QML Type

StateMachine 에 대한 범용 상태를 제공합니다. 더 보기...

Import Statement: import QtQml.StateMachine 6.8
Inherits:

QAbstractState

Inherited By:

StateMachine

속성

신호

상세 설명

상태 객체는 다른 상태로의 전환뿐만 아니라 자식 상태를 가질 수 있습니다. State는 Qt State Machine QML API의 일부입니다.

자식 상태가 있는 상태

childMode 속성은 자식 상태의 처리 방식을 결정합니다. 병렬 상태가 아닌 상태 그룹의 경우 initialState 속성을 사용하여 초기 상태를 설정해야 합니다. 자식 상태는 상호 배타적인 상태이며, 상태 머신은 부모 상태가 전환 대상일 때 어떤 자식 상태를 입력할지 알아야 합니다.

최종 자식 상태(FinalState)가 입력되면 상태는 State::finished() 신호를 보냅니다.

errorState 은 스테이트의 오류 상태를 설정합니다. 오류 상태는 상태를 입력하려고 할 때 오류가 감지되는 경우(예: 초기 상태가 설정되지 않아서) 상태 머신이 전환할 상태입니다.

사용 예

import QtQuick
import QtQml.StateMachine as DSM

Rectangle {
    DSM.StateMachine {
        id: stateMachine
        initialState: state
        running: true
        DSM.State {
            id: state
        }
    }
}

StateMachineFinalState참조하세요 .

프로퍼티 문서

childMode : enumeration

이 상태의 자식 모드

이 프로퍼티의 기본값은 QState.ExclusiveStates입니다.

이 열거형은 스테이트의 하위 상태 처리 방식을 지정합니다:

  • QState.ExclusiveStates 자식 상태는 상호 배타적이며 초기 상태는 initialState 속성을 설정하여 설정해야 합니다.
  • QState.ParallelStates 자식 상태는 병렬 상태입니다. 부모 상태가 입력되면 모든 자식 상태가 병렬로 입력됩니다.

errorState : QAbstractState

이 상태의 오류 상태입니다.


initialState : QAbstractState

이 상태의 초기 상태(자식 상태 중 하나)입니다.


신호 문서

finished()

이 신호는 이 상태의 최종 자식 상태가 입력될 때 발생합니다.

참고: 해당 핸들러는 onFinished 입니다.

QAbstractState::active, QAbstractState::entered, QAbstractState::exited도 참조하세요 .


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