Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QAbstractSlider::setRange ( int  min,
int  max 
) [inherited]

Sets the slider's minimum to min and its maximum to max.

If max is smaller than min, min becomes the only legal value.

See also:
minimum maximum

Definition at line 213 of file qabstractslider.cpp.

References QAbstractSlider::rangeChanged(), and QAbstractSlider::sliderChange().

Referenced by QListView::updateGeometries(), and QTableView::updateGeometries().

{
    Q_D(QAbstractSlider);
    int oldMin = d->minimum;
    int oldMax = d->maximum;
    d->minimum = min;
    d->maximum = qMax(min, max);
    if (oldMin != d->minimum || oldMax != d->maximum) {
        sliderChange(SliderRangeChange);
        emit rangeChanged(d->minimum, d->maximum);
        setValue(d->value); // re-bound
    }
}


Generated by  Doxygen 1.6.0   Back to index