API Documentation
Documentation for developing SailfishOS applicationsSlider QML Type
A horizontal slider More...
Import Statement: | import Sailfish.Silica 1.0 |
Properties
- animateValue : bool
- down : bool
- enabled : bool
- handleVisible : bool
- highlighted : bool
- label : string
- maximumValue : real
- minimumValue : real
- sliderValue : real
- stepSize : real
- value : real
- valueText : string
Detailed Description
The Slider type provides a horizontal slider.
A slider enables the user to drag a handle along a line to select a particular value within a specific range of values.
Here is a simple slider:
import Sailfish.Silica 1.0 Slider { width: parent.width minimumValue: 100 maximumValue: 200 value: 150 }
The Slider may be used to indicate progress by setting the enabled property to false to prevent user input.
Slider inherits the QtQuick MouseArea type, so any properties, signals and methods of MouseArea are also available to Slider objects. See the MouseArea documentation for its full list of available properties, signals and methods.
Property Documentation
Set animateValue to false when you don't want the slider to animate the value changes.
If true (default) user can interact with the Slider by touching or dragging on the Slider.
If false, the user cannot interact with the Slider. This is useful for sliders that only indicate progress and should not be interactive.
Displays a handle at the current value if true (default); otherwise no handle will be displayed and only the highlighted slider bar will be shown.
This property determines whether the slider is shown highlighted. By default it is bound to down.
The label to display under the slider. This text usually describes the function of the Slider.
See also valueText.
The current value of the slider displayed in the bar, i.e. bounded by the minimum and maximum values.
See also value.
The increment by which the value may be incremented/decremented. A stepSize of 0 (the default) will allow the value to be adjusted freely.
The stepSize increments are relative to the minimumValue, e.g. a stepSize of 0.5 and a minimumValue of 0.25 results in a valid sequence of 0.25, 0.75, 1.25, ...
Note this only restricts the values set by dragging the visual handle; it does not restrict the values set through the value property.
The current value of of the slider.
It is possible to set the value outside the bounds; however, the sliderValue will always be set to a valid value.
See also sliderValue.
Holds to text to display above the current value. This text usually represents the value of the Slider.
import Sailfish.Silica 1.0 Slider { minimumValue: 100 maximumValue: 200 value: 150 valueText: "$" + value }
See also label.