Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSlider set tick interval customized

QSlider set tick interval customized

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsliderintervaltick
4 Posts 2 Posters 3.0k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    marlenet15
    wrote on last edited by
    #1

    I have created a QSlider but I can't figure out how to change the tick interval to have two intervals in one QSlider. I would like the QSlider to be divided into three ticks but the range from 0 to the first tick is 50% out of the maximum value of the QSlider, from the first tick to the send tick would be 10%, and from the last tick to the end would be 40%. However, you can only do the tick interval evenly. Is there any way to customize it?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The most simple would probably be to subclass QAbstractSlider to customize the slider to your needs.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        The most simple would probably be to subclass QAbstractSlider to customize the slider to your needs.

        Hope it helps

        M Offline
        M Offline
        marlenet15
        wrote on last edited by
        #3

        @SGaist I couldn't find anything about setting different intervals for the ticks.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Because that's something you have to implemented and handle yourself.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved