IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

FinalState QML Type

Provides a final state.

This type was introduced in Qt 5.4.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

FinalState QML Type

  • Import Statement: import QtQml.StateMachine 6.4

  • Since:: Qt 5.4

  • Inherits:: QAbstractState

  • Group: FinalState is part of statemachine-qmltypes

Detailed Description

A final state is used to communicate that (part of) a StateMachine has finished its work. When a final top-level state is entered, the state machine's finished() signal is emitted. In general, when a final substate (a child of a State) is entered, the parent state's finished() signal is emitted. FinalState is part of Qt State Machine QML API

To use a final state, you create a FinalState object and add a transition to it from another state.

Example Usage

 
Sélectionnez
import QtQuick
import QtQml.StateMachine as DSM

Rectangle {
    DSM.StateMachine {
        id: stateMachine
        initialState: state
        running: true
        DSM.State {
            id: state
            DSM.TimeoutTransition {
                targetState: finalState
                timeout: 200
            }
        }
        DSM.FinalState {
            id: finalState
        }
        onFinished: console.log("state finished")
    }
}

See Also

See also StateMachine, State

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+