Slider QML Type

Used to select a value by sliding a handle along a track. 更多...

导入语句: import QtQuick.Controls .
Since: Qt Quick Ultralite 1.0
继承:

Control

特性

信号

方法

详细描述

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

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

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

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

另请参阅 Controls Styling and 输入控件 .

特性文档编制

from : real

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

另请参阅 to and value .


handle : Item

This property holds the handle item.

另请参阅 Controls Styling .


[read-only] horizontal : bool

This property holds whether the slider is horizontal.

另请参阅 orientation .


orientation : enumeration

This property holds the orientation.

可能的值:

常量 描述
Qt.Horizontal Horizontal (default)
Qt.Vertical Vertical

另请参阅 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 .

另请参阅 value , visualPosition ,和 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 .

另请参阅 from and value .


value : real

This property holds the value in the range from - to 。默认值为 0.0 .

另请参阅 position .


[read-only] vertical : bool

This property holds whether the slider is vertical.

另请参阅 orientation .


[read-only] visualPosition : real

This property holds the visual position of the handle.

另请参阅 position .


信号文档编制

moved ()

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

注意: 相应处理程序是 onMoved .


方法文档编制

real valueAt ( real position )

Returns the value for the given position .

另请参阅 value and position .