PDA

View Full Version : how to number the ticks of QSlider



babu198649
5th June 2008, 15:07
hi
i need to number the tickmarks of QSlider.how to proceed with it. i have seen this is possible in Qwt but i am using a subclassed QSlider which has other functions and hence i need to number the tickmarks of QSlider .

wysota
5th June 2008, 17:13
int numberOfTicks = (slider->maximum() - slider->minimum())/slider->tickInterval()+1;

marcel
5th June 2008, 17:25
Isn't he talking about labeling the slider's ticks? in this case, it is not possible by default

wysota
5th June 2008, 19:35
Right, I misunderstood the question. By default - no, but one can subclass, reimplement sizeHint and paint the numbers in the paintEvent. I wouldn't do that though...

aamer4yu
11th June 2008, 13:46
Wont it be too congested even if you do that ??
How about setting a tooltip as the the slider value :cool: