The boundaries of a scale and the position of all ticks are defined by a QwtScaleDiv object. Tick labels are painted for major ticks.
A scale division can be assigned manually from application code or can be aligned/calculated by a QwtScaleEngine from its boundaries and a step size. A scale engine implements 2 algorithms:
- aligning the boundaries
see QwtScaleEngine::autoScale()- finding the ticks
see QwtScaleEngine::divideScale()
Each type of scale engine offers parameters that have an impact on its algorithm.
In case of a slider calculating the scale div manually ( QwtAbstractScale::setScale( const QwtScaleDiv & ) ) might be an option, but in case of plot axes the application code often doesn't know about the scales - f.e. when your plot offers any type of navigation ( zooming, panning ... ) - and you need to have an algo for calculating boundaries and ticks.
In case of QwtSlider most relevant methods can be found in its base class QwtAbstractScale.
HTH,
Uwe
Bookmarks