.BI "void \fBsetRange\fR ( int minValue, int maxValue )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "int \fBlineStep\fR - the current line step"
.br
.ti -1c
.BI "int \fBmaxValue\fR - the current maximum value of the slider"
.br
.ti -1c
.BI "int \fBminValue\fR - the current minimum value of the slider"
.br
.ti -1c
.BI "Orientation \fBorientation\fR - the slider's orientation"
.br
.ti -1c
.BI "int \fBpageStep\fR - the current page step"
.br
.ti -1c
.BI "int \fBtickInterval\fR - the interval between tickmarks"
.br
.ti -1c
.BI "TickSetting \fBtickmarks\fR - the tickmark settings for this slider"
.br
.ti -1c
.BI "bool \fBtracking\fR - whether slider tracking is enabled"
.br
.ti -1c
.BI "int \fBvalue\fR - the current slider value"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBvalueChange\fR ()"
.br
.ti -1c
.BI "virtual void \fBrangeChange\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QSlider widget provides a vertical or horizontal slider.
.PP
The slider is the classic widget for controlling a bounded value. It lets the user move a slider along a horizontal or vertical groove and translates the slider's position into an integer value within the legal range.
.PP
QSlider inherits QRangeControl, which provides the "integer" side of the slider. setRange() and value() are likely to be used by practically all slider users; see the QRangeControl documentation for information about the many other functions that class provides.
.PP
The main functions offered by the slider itself are tickmark and orientation control; you can use setTickmarks() to indicate where you want the tickmarks to be, setTickInterval() to indicate how many of them you want and setOrientation() to indicate whether the slider is to be horizontal or vertical.
.PP
A slider accepts focus on Tab and uses the mouse wheel and a suitable keyboard interface.
.PP
.ce 1
.B "[Image Omitted]"
.PP
.ce 1
.B "[Image Omitted]"
.PP
See also QScrollBar, QSpinBox, GUI Design Handbook: Slider, and Basic Widgets.
.SS "Member Type Documentation"
.SH "QSlider::TickSetting"
This enum specifies where the tickmarks are to be drawn relative to the slider's groove and the handle the user moves.
.TP
\fCQSlider::NoMarks\fR - do not draw any tickmarks.
.TP
\fCQSlider::Both\fR - draw tickmarks on both sides of the groove.
.TP
\fCQSlider::Above\fR - draw tickmarks above the (horizontal) slider
.TP
\fCQSlider::Below\fR - draw tickmarks below the (horizontal) slider
.TP
\fCQSlider::Left\fR - draw tickmarks to the left of the (vertical) slider
.TP
\fCQSlider::Right\fR - draw tickmarks to the right of the (vertical) slider
Constructs a slider whose value can never be smaller than \fIminValue\fR or greater than \fImaxValue\fR, whose page step size is \fIpageStep\fR and whose value is initially \fIvalue\fR (which is guaranteed to be in range using bound()).
.SH "void QRangeControl::setRange ( int minValue, int maxValue )"
Sets the range control's minimum value to \fIminValue\fR and its maximum value to \fImaxValue\fR.
.PP
Calls the virtual rangeChange() function if one or both of the new minimum and maximum values are different from the previous setting. Calls the virtual valueChange() function if the current value is adjusted because it was outside the new range.
.PP
If \fImaxValue\fR is smaller than \fIminValue\fR, \fIminValue\fR becomes the only legal value.
.PP
See also minValue and maxValue.
.PP
Examples:
.)l listbox/listbox.cpp, t12/lcdrange.cpp, t5/main.cpp, t6/main.cpp, t8/lcdrange.cpp, and xform/xform.cpp.
.SH "void QSlider::setTickInterval ( int )\fC [virtual]\fR"
Sets the interval between tickmarks. See the "tickInterval" property for details.
Set this property's value with setOrientation() and get this property's value with orientation().
.SH "int pageStep"
This property holds the current page step.
.PP
When setting pageStep, the virtual stepChange() function will be called if the new page step is different from the previous setting.
.PP
See also QRangeControl::setSteps(), lineStep, and setRange().
.PP
Set this property's value with setPageStep() and get this property's value with pageStep().
.SH "int tickInterval"
This property holds the interval between tickmarks.
.PP
This is a value interval, not a pixel interval. If it is 0, the slider will choose between lineStep() and pageStep(). The initial value of tickInterval is 0.
.PP
See also QRangeControl::lineStep() and QRangeControl::pageStep().
.PP
Set this property's value with setTickInterval() and get this property's value with tickInterval().
.SH "TickSetting tickmarks"
This property holds the tickmark settings for this slider.
.PP
The valid values are in QSlider::TickSetting. The default is NoMarks.
.PP
See also tickInterval.
.PP
Set this property's value with setTickmarks() and get this property's value with tickmarks().
.SH "bool tracking"
This property holds whether slider tracking is enabled.
.PP
If tracking is enabled (the default), the slider emits the valueChanged() signal whenever the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal when the user releases the mouse button (unless the value happens to be the same as before).
.PP
Set this property's value with setTracking() and get this property's value with tracking().
.SH "int value"
This property holds the current slider value.
.PP
Set this property's value with setValue() and get this property's value with value().