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

StateGroup QML Type

Provides built-in state support for non-Item types.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

StateGroup QML Type

  • Import Statement: import QtQuick

  • Group: StateGroup is part of qtquick-states

Detailed Description

Item (and all derived types) provides built in support for states and transitions via its state, states and transitions properties. StateGroup provides an easy way to use this support in other (non-Item-derived) types.

 
Sélectionnez
MyCustomObject {
    StateGroup {
        id: myStateGroup
        states: State {
            name: "state1"
            // ...
        }
        transitions: Transition {
            // ...
        }
    }

    onSomethingHappened: myStateGroup.state = "state1";
}

See Also

Property Documentation

 

state : string

This property holds the name of the current state of the state group.

This property is often used in scripts to change between states. For example:

 
Sélectionnez
function toggle() {
    if (button.state == 'On')
        button.state = 'Off';
    else
        button.state = 'On';
}

If the state group is in its base state (i.e. no explicit state has been set), state will be a blank string. Likewise, you can return a state group to its base state by setting its current state to ''.

See Also

See also Qt Quick States

[read-only] states : list<State>

This property holds a list of states defined by the state group.

 
Sélectionnez
StateGroup {
    states: [
        State {
            // State definition...
        },
        State {
            // ...
        }
        // Other states...
    ]
}
See Also

See also Qt Quick States

[read-only] transitions : list<Transition>

This property holds a list of transitions defined by the state group.

 
Sélectionnez
StateGroup {
    transitions: [
        Transition {
          // ...
        },
        Transition {
          // ...
        }
        // ...
    ]
}
See Also

See also Transitions

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