Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, May 2007
QSlider Snap to Tick Marks


Message 1 in thread

I would like to use a QSlider in my application. The problem I have is 
that the slider is "continuous" and not discrete. For example I would 
like to have a range from 1000 to 7000 (inclusive) but only allow the 
slider handle to "land" on increments of 1000. I can set the tickmarks 
to increments of 1000 and while the slider looks fine the user can 
still select a value between any of the tick marks. I tried setting the 
"singleStep" value and the pagestep value but that didn't help. I tried 
setting tracking to "off" but that didn't help either.
  Is it possible to do what I want with a prefab widget? or am I faced 
with subclassing the QSlider widget to implement the functionality. I 
know this is supported on OS X but not sure about other platforms.

Thanks for any help or suggestions.
 Mike Jackson

--
 [ signature omitted ]