StateGroup QML Type
Proporciona soporte de estado integrado para tipos que no son elementos. Más...
| Import Statement: | import QtQuick |
Propiedades
- state : string
- states : list<State>
- transitions : list<Transition>
Descripción detallada
Item (y todos los tipos derivados) proporciona soporte integrado para estados y transiciones a través de sus propiedades state, states y transitions. StateGroup proporciona una forma sencilla de utilizar este soporte en otros tipos (no derivados de Item).
MyCustomObject { StateGroup { id: myStateGroup states: State { name: "state1" // ... } transitions: Transition { // ... } } onSomethingHappened: myStateGroup.state = "state1"; }
Véase también Qt Quick States, Transitions, and Qt Qml.
Documentación de Propiedades
state : string
Esta propiedad contiene el nombre del estado actual del grupo de estados.
Esta propiedad se utiliza a menudo en scripts para cambiar entre estados. Por ejemplo:
function toggle() {
if (button.state == 'On')
button.state = 'Off';
else
button.state = 'On';
}Si el grupo de estados está en su estado base (es decir, no se ha establecido ningún estado explícito), state será una cadena en blanco. Del mismo modo, puede devolver un grupo de estados a su estado base estableciendo su estado actual en ''.
Véase también Qt Quick Estados.
states : list<State> [read-only]
Esta propiedad contiene una lista de estados definidos por el grupo de estados.
StateGroup { states: [ State { // State definition... }, State { // ... } // Other states... ] }
Véase también Qt Quick States.
transitions : list<Transition> [read-only]
Esta propiedad contiene una lista de transiciones definidas por el grupo de estados.
StateGroup { transitions: [ Transition { // ... }, Transition { // ... } // ... ] }
Véase también Transiciones.
© 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.