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 and singleStep
Forum Updated to NodeBB v4.3 + New Features

QSlider and singleStep

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 421 Views 2 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.
  • K Offline
    K Offline
    Kris Revi
    wrote on last edited by
    #1

    so this is annoying the singleStep only works with keyboard key inputs but when dragging the slider with the mouse it ignores it!

    i've set the singleStep = 2 so and the min=2 and max=256 and i want to step by 2 and not 1 when using the mouse on the slider!

    any fix / workaround for this at all?

    Pl45m4P 1 Reply Last reply
    0
    • K Kris Revi

      so this is annoying the singleStep only works with keyboard key inputs but when dragging the slider with the mouse it ignores it!

      i've set the singleStep = 2 so and the min=2 and max=256 and i want to step by 2 and not 1 when using the mouse on the slider!

      any fix / workaround for this at all?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @Kris-Revi

      If you grab the slider handle with your mouse, it doesn't use steps. You can move it around independently.
      Steps are used when navigating the handle with your keyboard.

      Arrow keys for single steps, PageUp/Down for pageSteps...

      There is no workaround, you have to code your own, custom slider :)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      4
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        There's nothing to fix. I think you misunderstand what singleStep purpose is. If it affected dragging it would defeat the whole point of a slider.

        If you want only even values just divide your range by 2 i.e. min=1, max=128 and then multiply the value by 2.

        1 Reply Last reply
        2

        • Login

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