이 페이지에서

State QML Type

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

Import Statement: import QtQml.StateMachine 6.12
Inherits:

QAbstractState

Inherited By:

StateMachine

속성

신호

상세 설명

상태 객체는 자식 상태를 가질 수 있을 뿐만 아니라 다른 상태로 전환할 수도 있습니다. 상태는 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
        }
    }
}

StateMachine 및 FinalState도 참조하십시오 .

속성 설명서

childMode : enumeration

이 상태의 자식 모드

이 속성의 기본값은 ` QState.ExclusiveStates`입니다.

이 열거형은 상태의 자식 상태들이 어떻게 처리되는지를 지정합니다:

  • QState.ExclusiveStates 자식 상태들은 상호 배타적이며, initialState 속성을 설정하여 초기 상태를 지정해야 합니다.
  • QState.ParallelStates 자식 상태들은 병렬로 작동합니다. 부모 상태에 진입하면, 모든 자식 상태에 병렬로 진입하게 됩니다.

errorState : QAbstractState

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

initialState : QAbstractState

이 상태(그 자식 상태 중 하나)의 초기 상태.

신호 문서

finished()

이 신호는 이 상태의 최종 자식 상태로 진입할 때 발생합니다.

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

QAbstractState::active, QAbstractState::entered 및 QAbstractState::exited도 참조하십시오 .

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