FinalState QML Type
Proporciona un estado final. Más...
| Import Statement: | import QtQml.StateMachine 6.12 |
| Inherits: |
Descripción detallada
Un estado final se utiliza para indicar que (parte de) un estado de máquina de estados ( StateMachine ) ha finalizado su trabajo. Cuando se entra en un estado final de nivel superior, se emite la señal « finished()» de la máquina de estados. En general, cuando se entra en un subestado final (un hijo de un «State»), se emite la señal « finished()» del estado padre. FinalState forma parte de la API QML deQt State Machine
Para utilizar un estado final, se crea un objeto `FinalState` y se le añade una transición desde otro estado.
Ejemplo de uso
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")
}
}Véase también StateMachine y State.
© 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.