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

SwitchDelegate QML Type

Item delegate with a switch indicator that can be toggled on or off.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

SwitchDelegate QML Type

  • Import Statement: import QtQuick.Controls

  • Inherits: ItemDelegate

  • Group: SwitchDelegate is part of qtquickcontrols-delegates

Detailed Description

Image non disponible

SwitchDelegate presents an item delegate that can be toggled on (checked) or off (unchecked). Switch delegates are typically used to select one or more options from a set of options. For smaller sets of options, or for options that need to be uniquely identifiable, consider using Switch instead.

SwitchDelegate inherits its API from ItemDelegate, which is inherited from AbstractButton. For instance, you can set text, and react to clicks using the AbstractButton API. The state of the switch delegate can be set with the checked property.

 
Sélectionnez
ListView {
    model: ["Option 1", "Option 2", "Option 3"]
    delegate: SwitchDelegate {
        text: modelData
    }
}

See Also

Property Documentation

 

[read-only] position : real

This property holds the logical position of the thumb indicator.

The position is expressed as a fraction of the indicator's size, in the range 0.0 - 1.0. The position can be used for example to determine whether the thumb has been dragged past the halfway point. For visualizing a thumb indicator, the right-to-left aware visualPosition should be used instead.

See Also

See also visualPosition

[read-only] visualPosition : real

This property holds the visual position of the thumb indicator.

The position is expressed as a fraction of the indicator's size, in the range 0.0 - 1.0. When the control is mirrored, the value is equal to 1.0 - position. This makes the value suitable for visualizing the thumb indicator taking right-to-left support into account. In order to for example determine whether the thumb has been dragged past the halfway point, the logical position should be used instead.

See Also

See also position

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