StateGroup QML Type
Ofrece compatibilidad integrada con el estado para tipos que no sean «Item». Más información...
| Import Statement: | import QtQuick |
Propiedades
- state : string
- states : list<State>
- transitions : list<Transition>
Descripción detallada
El tipo `Item` (y todos los tipos derivados de él) ofrece soporte integrado para estados y transiciones a través de sus propiedades ` state`, ` states ` y ` transitions `. El tipo `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 Estados, transiciones yQt Quick 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 de un estado a otro. Por ejemplo:
function toggle() {
if (button.state == 'On')
button.state = 'Off';
else
button.state = 'On';
}Si el grupo de estados se encuentra en su estado base (es decir, no se ha establecido ningún estado explícito), ` state ` será una cadena vacía. Del mismo modo, puedes devolver un grupo de estados a su estado base estableciendo su estado actual en ` ''`.
Véase también «Estadosde Qt Quick ».
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 Estadosde «Qt Quick ».
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.