QRangeControl(3qt)

NAME
QRangeControl - Integer value within a range

SYNOPSIS

#include <qrangecontrol.h>

Inherited by QScrollBar, QSlider and QSpinBox.

  Public Members
QRangeControl ()
QRangeControl ( int minValue, int maxValue, int lineStep, int pageStep, int value )
int value () const
void setValue ( int )
void addPage ()
void subtractPage ()
void addLine ()
void subtractLine ()
int minValue () const
int maxValue () const
void setRange ( int minValue, int maxValue )
int lineStep () const
int pageStep () const
void setSteps ( int line, int page )

  Protected Members
void directSetValue ( int val )
int prevValue () const
virtual void valueChange ()
virtual void rangeChange ()
virtual void stepChange ()

DESCRIPTION
The QRangeControl class provides an integer value within a range.

This class has many functions to manipulate a value inside a range. It was specifically designed for the QScrollBar widget, but it can also be practical for other purposes.

The three virtual functions valueChange(), rangeChange() and stepChange() can be reimplemented in a subclass to detect range control changes.

MEMBER FUNCTION DOCUMENTATION

QRangeControl::QRangeControl ()
Constructs a range control with min value 0, max value 99, line step 1, page step 10 and initial value 0.

QRangeControl::QRangeControl ( int minValue, int maxValue, int lineStep, int pageStep, int value )
Constructs a range control with the specified parameters.

void QRangeControl::addLine ()
Equivalent to

 setValue( value()+lineStep() )

See also: subtractLine().

void QRangeControl::addPage ()
Equivalent to

 setValue( value()+pageStep() )

See also: subtractPage().

void QRangeControl::directSetValue ( int value ) [protected]
Sets the range control value directly without calling valueChange().

Adjusts the value if it is less than the min value or greater than the max value.

See also: setValue().

int QRangeControl::lineStep () const
Returns the current line step.

See also: setSteps() and pageStep().

int QRangeControl::maxValue () const
Returns the current maximum value in the range.

See also: setRange() and minValue().

int QRangeControl::minValue () const
Returns the current minimum value in the range.

See also: setRange() and maxValue().

int QRangeControl::pageStep () const
Returns the current page step.

See also: setSteps() and lineStep().

int QRangeControl::prevValue () const [protected]
Returns the previous range control value.

See also: value().

void QRangeControl::rangeChange () [virtual protected]
This virtual function is called whenever the range control range changes. You can reimplment it if you want to be notified when the range changes. The default implementation does nothing.

See also: setRange(), valueChange() and stepChange().

Reimplemented in QSlider and QScrollBar.

void QRangeControl::setRange ( int minValue, int maxValue )
Sets the range min value to minValue and the max value to maxValue.

Calls the virtual rangeChange() function if the new min and max values are different from the previous setting. Calls the virtual valueChange() function if the current value is outside the new range and has to be adjusted.

See also: minValue() and maxValue().

Examples: xform/xform.cpp

void QRangeControl::setSteps ( int lineStep,int pageStep )
Sets the range line step to lineStep and page step to pageStep.

Calls the virtual stepChange() function if the new line step and/or page step are different from the previous setting.

See also: setRange().

void QRangeControl::setValue ( int value )
Sets the range control value to value.

Adjusts the value if it is less than the min value or greater than the max value.

Calls the virtual valueChange() function if the value is different from the previous value.

void QRangeControl::stepChange () [virtual protected]
This virtual function is called whenever the range control step value changes. You can reimplment it if you want to be notified when the step changes. The default implementation does nothing.

See also: setSteps(), rangeChange() and valueChange().

Reimplemented in QScrollBar.

void QRangeControl::subtractLine ()
Equivalent to

 setValue( value()-lineStep() )

See also: addLine().

void QRangeControl::subtractPage ()
Equivalent to

 setValue( value()-pageStep() )

See also: addPage().

int QRangeControl::value () const
Returns the current range control value.

See also: setValue() and prevValue().

Examples: xform/xform.cpp

void QRangeControl::valueChange () [virtual protected]
This virtual function is called whenever the range control value changes. You can reimplment it if you want to be notified when the value changes. The default implementation does nothing.

See also: setValue(), addPage(), subtractPage(), addLine(), subtractLine(), rangeChange() and stepChange().

Reimplemented in QSlider and QScrollBar.

SEE ALSO
http://www.troll.no/qt/qrangecontrol.html

COPYRIGHT
Copyright 1992-1997 Troll Tech AS. See the LICENSE file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.