From 10:00 CET Friday 22nd November we will adjust how the server works to deal with some recently reported problems. Therefore there may be a load problem, if you experience more problems than usual trying to access the forum then please PM AndyS or any of the moderators so they can inform me.


Slider Tickmarks Layout



  • Hello,

    I am trying to put some simple labels under/over a slider with tickmarks. However, I have some problems of accurately aligning labels to the ticks. In particular, the tickmarks are offset from the two endpoints of the slider. Is there a good (ideally platform independent) way to figure out the position of the first/last tickmark within is widget ? In the default Mac OS 10.6 style it seems both are offset by 9 pixels. I have tried to query things like QStyle::PM_SliderThickness and company but I am either querying the wrong style or these do not have the information I need. I am new to Qt so I am wondering whether there is an easy way to figure this out or whether there are inherent reasons why this should/cannot be easily determined in a general way.

    Thanks in advance for any hint



  • Good question. I guess this is tricky to do with the standard Qt slider widget. What you might considder (if possible for you), is to use Qwt instead. It provides more options for its slider widget, including having custom scales. It even supports logartitmic scales.


Log in to reply