C
StateGroup QML Type
Provides state support for non-Item types. More...
Import Statement: | import QtQuick |
Since: | Qt Quick Ultralite 2.10 |
Inherits: |
Properties
- state : string
- states : list<State>
- transitions : list<Transition>
Detailed Description
Visual types that inherit from Item already have built-in state, states and transitions properties, whereas non-visual types lack this capability. StateGroup provides a way to support states and transitions in non-visual types.
Additionally, StateGroup allows states to be structured into groups, enabling independent control over different sets of states. This enables managing state changes separately, from the Item's states property and other StateGroup instances.
MyCustomObject { StateGroup { id: myStateGroup states: State { name: "state1" // ... } transitions: Transition { // ... } } onSomethingHappened: myStateGroup.state = "state1"; }
Note: A StateGroup is only valid when declared as a top-level object in the document. If placed anywhere else within the tree structure, the qmltocpp reports an error.
See also Using States and Animation and Transitions.
Property Documentation
state : string |
This property holds the name of the current state of the state group.
If the state group is in its base state (that is, no explicit state is set), this property holds an empty string. You can also return a state group to its base state by setting its current state to an empty string.
See also Using States.
This property holds the list of possible states defined by the state group.
StateGroup { states: [ State { // State definition... }, State { // ... } // Other states... ] }
See also Using States.
transitions : list<Transition> |
This property holds a list of transitions defined by the state group.
StateGroup { transitions: [ Transition { // ... }, Transition { // ... } // ... ] }
See also Animation and Transitions.
Available under certain Qt licenses.
Find out more.