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

Dial QML Type

Circular dial that is rotated to set a value.

This type was introduced in Qt 5.7.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Dial QML Type

  • Import Statement: import QtQuick.Controls 2.4

  • Since: Qt 5.7

  • Inherits: Control

  • Group: Dial is part of qtquickcontrols2-input

Detailed Description

The Dial is similar to a traditional dial knob that is found on devices such as stereos or industrial equipment. It allows the user to specify a value within a range.

Image non disponible

The value of the dial is set with the value property. The range is set with the from and to properties. To enable or disable wrapping, use the wrap property.

The dial can be manipulated with a keyboard. It supports the following actions:

Action

Key

Decrease value by stepSize

Qt.Key_Left

Decrease value by stepSize

Qt.Key_Down

Set value to from

Qt.Key_Home

Increase value by stepSize

Qt.Key_Right

Increase value by stepSize

Qt.Key_Up

Set value to to

Qt.Key_End

See Also

Property Documentation

 

[read-only] angle : real

This property holds the angle of the handle.

The range is from -140 degrees to 140 degrees.

See Also

See also position

from : real

This property holds the starting value for the range. The default value is 0.0.

See Also

See also to, value

handle : Item

This property holds the handle of the dial.

The handle acts as a visual indicator of the position of the dial.

See Also

See also Customizing Dial

[since QtQuick.Controls 2.2 (Qt 5.9)] live : bool

This property holds whether the dial provides live updates for the value property while the handle is dragged.

The default value is true.

This property was introduced in QtQuick.Controls 2.2 (Qt 5.9).

See Also

See also value

[read-only] position : real

This property holds the logical position of the handle.

The position is expressed as a fraction of the control's angle range (the range within which the handle can be moved) in the range 0.0 - 1.0.

See Also

See also value, angle

pressed : bool

This property holds whether the dial is pressed.

The dial will be pressed when either the mouse is pressed over it, or a key such as Qt.Key_Left is held down. If you'd prefer not to have the dial be pressed upon key presses (due to styling reasons, for example), you can use the Keys attached property:

 
Sélectionnez
Dial {
    Keys.onLeftPressed: {}
}

This will result in pressed only being true upon mouse presses.

snapMode : enumeration

This property holds the snap mode.

The snap mode works with the stepSize to allow the handle to snap to certain points along the dial.

Possible values:

Constant

Description

Dial.NoSnap

The dial does not snap (default).

Dial.SnapAlways

The dial snaps while the handle is dragged.

Dial.SnapOnRelease

The dial does not snap while being dragged, but only after the handle is released.

See Also

See also stepSize

stepSize : real

This property holds the step size.

The step size determines the amount by which the dial's value is increased and decreased when interacted with via the keyboard. For example, a step size of 0.2, will result in the dial's value increasing and decreasing in increments of 0.2.

The step size is only respected for touch and mouse interaction when snapMode is set to a value other than Dial.NoSnap.

The default value is 0.0, which results in an effective step size of 0.1 for keyboard interaction.

See Also

See also snapMode, increase(), decrease()

to : real

This property holds the end value for the range. The default value is 1.0.

See Also

See also from, value

value : real

This property holds the value in the range from - to. The default value is 0.0.

See Also

See also position, live

wrap : bool

This property holds whether the dial wraps when dragged.

For example, when this property is set to true, dragging the dial past the to position will result in the handle being positioned at the from position, and vice versa:

Image non disponible

When this property is false, it's not possible to drag the dial across the from and to values.

Image non disponible

The default value is false.

Signal Documentation

 

[since QtQuick.Controls 2.2 (Qt 5.9)] moved()

This signal is emitted when the dial has been interactively moved by the user by either touch, mouse, or keys.

The corresponding handler is onMoved.

This signal was introduced in QtQuick.Controls 2.2 (Qt 5.9).

Method Documentation

 

void decrease()

Decreases the value by stepSize, or 0.1 if stepSize is not defined.

See Also

See also stepSize

void increase()

Increases the value by stepSize, or 0.1 if stepSize is not defined.

See Also

See also stepSize

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