What major ticks do you want to see for which range ?
Uwe
What major ticks do you want to see for which range ?
Uwe
Major ticks in the same place as the labels. So labels and major ticks every 200, no minor ticks and the slider snapping every 10.
It doesn't need to be exactly 200, that's just an example. I want a reasonable number of major ticks and labels, like 5 or 6.
Last edited by snowbound; 14th March 2014 at 12:38.
What is always the case: labels are painted at major ticks by definition.Major ticks in the same place as the labels.
These are contradictory statements - you can control the step size or the number of steps, not both.It doesn't need to be exactly 200, that's just an example. I want a reasonable number of major ticks and labels, like 5 or 6.
Uwe
What I'm trying to achieve in 6.1 is the lower right horizontal slider in the example project from 6.0. The one that goes from 1000 to 3000, has major labels every 500 and the slider step size is 10.
Scale and step sizes have been decoupled because of non linear ( f.e. logarithmic ) scales - what is a new feature of Qwt 6.1
For controlling the major ticks see: QwtAbstractScale::setScaleMaxMajor( int ), but the default setting of 8 should be o.k. Remove all what you tried so far and simply do a "slider->setScale( 1000, 3000);"
For controlling the number of steps have a look at the methods in QwtAbstractSlider. In case of a linear scale you can calculate the number of steps easily this way: numSteps = ( max - min ) / stepSize;
Uwe
snowbound (14th March 2014)
Bookmarks