I see, so the movement from a tick to another always is 1 unit.
For example, for a slider that only can take the values 0->25->50->75->100, I have to create a slider from 0->4 with tickInterval=1, and then multiply the value by 4.
slider.setTickInterval(1);
slider.setRange(0,4);
...
int nPercentVal = slider.value() * 4;
QSlider slider;
slider.setTickInterval(1);
slider.setRange(0,4);
...
int nPercentVal = slider.value() * 4;
To copy to clipboard, switch view to plain text mode
So, isn't a way to avoid that multiplication (setting range 0->100) but slider handle only moving through 5 ticks in the slider?
Bookmarks