Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Slider Tickmarks Layout

    3rd Party Software
    2
    2
    2423
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      ptbremer last edited by

      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

      1 Reply Last reply Reply Quote 0
      • A
        andre last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post