View Full Version : QSlider tickInterval

16th September 2008, 11:51
I want to make slider smooth. I dont need any tick.

What value should I pass in QSlider::setTickInterval();
Or do I need to work something extra ?

16th September 2008, 11:58

ui.Slider->setStyleSheet("QSlider::groove:horizontal {border: 1px solid #999999; height: 6px; background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4); margin: 2px 0; border-radius: 4px; } QSlider::handle:horizontal { background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f); border: 1px solid #5c5c5c; width: 6px; margin: -4px 0; border-radius: 3px;} ");

Thanks and regards,

16th September 2008, 12:18
How about using QSlider::setTickPosition , with QSlider::NoTicks.

Will that work for you ?

16th September 2008, 12:29
@ aamer
This property only holds the tickmark position for this slider.
No tick means no tickmark will be drawn..

Anyways I got it how to do..
We cannot remove tick interval, we just can make range higher so tick interval will be very low, so then it will look much smoother.

Consider a slider 100 pixels long. We set range to 1 to 10, so here the tick interval = 100/10
means 10 pixels will be the interval.

Consider a slider 100 pixels long. We set range to 1 to 100, so here the tick interval = 100/100
means 1 pixel will be interval..so it will look 10 times smoother.

Have fun guys. Thanx for help.
now you can look into