Signal Handlers

Detailed Description

The range is set by the slider's minimumValue and maximumValue. The value is incremented using the stepSize property. If the minimumValue is 0, the maximumValue is 100, and the stepSize value is 40, the possible Slider values are 0, 40, 80, and 100. All the numeric values of the slider are floating point values.

When the user slides the handle, the value is updated and the valueChanged signal is emitted . If the valueIndicatorVisible property is true, the value indicator is shown beside the handle when the user presses the handle. The value indicator shows the text of valueIndicatorText, but if valueIndicatorText contains an empty string, the indicator shows the current value instead.

Setting Up a Slider

In the code snippet below the slider's maximum, minimum, and current values are set as well as the step size. The valueIndicatorVisible property is set to true.

In the the screenshot below the slider's value is shown on the value indicator.

A vertical slider is configured by setting the property orientation to Qt.Vertical. This slider also has a visible value indicator and the inverted property is set to true, so the minimum value is at the bottom of the slider. The value of the valueIndicatorText property is Volume.

When the user drags the slider's handle, the value indicator shows the text Volume.

Property Documentation

inverted : bool

Inverts the progression of the slider. When false, the positive progression is from left to right or top to bottom. Setting the property to true will switch the progression from right to left or bottom to top.

The default value is false.

maximumValue : real

The maximum value of the slider's range. The default value is 1.

minimumValue : real

The minimum value of the slider's range. The default value is 0.

orientation : int

The orientation of the slider. Use Qt.Horizontal for left-right sliding and Qt.Vertical for up-down sliding. The default value is Qt.Horizontal.

While the user presses and holds the slider handle, the pressed value is true; otherwise false.

stepSize : real

The size of the step between the minimum and maximum values. The default value is 0.

value : real

The current value of the slider. The position of the slider's handle indicates graphically the current value. The default value is 0.

valueIndicatorText : string

If valueIndicatorText is an empty string, the slider's value will be displayed when the user drags the slider handle. If valueIndicatorText contains a non-empty string value, that value is shown when the user drags the slider handle. The value indicator is shown only if the valueIndicatorVisible is true and the user presses the slider handle; otherwise the value indicator is not shown. The default value is an empty string.

Controls whether the value indicator is visible when the user presses the slider handle. The value indicator is shown only when the valueIndicatorVisible property is true and the user presses the slider handle; otherwise the value indicator is not visible. The default value is false.

All other trademarks are property of their respective owners. Privacy Policy

Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.