C

Slider QML Type

Used to select a value by sliding a handle along a track. More...

Import Statement: import QtQuick.Controls
Since: Qt Quick Ultralite 1.0
Inherits:

Control

Properties

Signals

Methods

Detailed Description

Slider is used to select a value by sliding a handle along a track.

In the example below, custom from, value, and to values are set:

Slider {
    from: 1
    value: 25
    to: 100
}

The position property is expressed as a fraction of the control's size, in the range 0.0 - 1.0. The visualPosition is useful for positioning the handle when styling Slider.

See also Controls Styling and Input Controls.

Property Documentation

from : real

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

See also to and value.


handle : Item

This property holds the handle item.

See also Controls Styling.


[read-only] horizontal : bool

This property holds whether the slider is horizontal.

See also orientation.


orientation : enumeration

This property holds the orientation.

Possible values:

ConstantDescription
Qt.HorizontalHorizontal (default)
Qt.VerticalVertical

See also horizontal and vertical.


[read-only] position : real

This property holds the logical position of the handle.

The position is expressed as a fraction of the control's size, in the range 0.0 - 1.0.

See also value, visualPosition, and valueAt().


pressed : bool

This property holds whether the slider is pressed by either touch, mouse, or keys.


stepSize : real

This property holds the step size. The default value is 0.0.


to : real

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

See also from and value.


value : real

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

See also position.


[read-only] vertical : bool

This property holds whether the slider is vertical.

See also orientation.


[read-only] visualPosition : real

This property holds the visual position of the handle.

See also position.


Signal Documentation

moved()

This signal is emitted when the slider has been interactively moved by the user.

Note: The corresponding handler is onMoved.


Method Documentation

real valueAt(real position)

Returns the value for the given position.

See also value and position.


Available under certain Qt licenses.
Find out more.