QSlider is a Qt class that represents a vertical or horizontal slider.
A slider lets a user move a handle along a horizontal or vertical line, and then translates the handle position into a value within a range.
To use QSlider
, a number of options must be set, including:
- minimum value through
setMinimum()
- maximum value through
setMaximum()
- step value through
setSingleStep()
A minimalistic example of a QSlider
looks like this:
QSlider *s = new QSlider();
s->setMaximum(100);
s->setMinimum(0);
s->setSingleStep(1);
s->show();
Official documentation can be found here.