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 setting a certain increment
Qt 6.11 is out! See what's new in the release blog

QSlider setting a certain increment

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 2.4k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I am using a QSlider for some of my QCamerImageProcessing functions and the values for some of these functions are -1 to 1 which I put those as my min/max of the slider. I am trying to increment the slider to move by 0.2 intervals but right now it is moving by 1 increments. So basically I have a slider that either goes to 1 or -1 with one click. I cannot find the right command to switch the incrementsize of the QSlider. What command can I use?

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

      Hi,

      AFAIK, you can't however, you can make it go from -10 to +10 and set the step count to 2. Then you only have to divide the result by 10 before sending it to your QCamerImageProcessing functions.

      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

      ? 2 Replies Last reply
      0
      • SGaistS SGaist

        Hi,

        AFAIK, you can't however, you can make it go from -10 to +10 and set the step count to 2. Then you only have to divide the result by 10 before sending it to your QCamerImageProcessing functions.

        Hope it helps

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @SGaist Thank you, that works aswell, however I see that the QCameraImageProcessing only changes when it is -1,0, or 1 and nothing before or after that, so regardless only at one point it will change the picture quality.

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          AFAIK, you can't however, you can make it go from -10 to +10 and set the step count to 2. Then you only have to divide the result by 10 before sending it to your QCamerImageProcessing functions.

          Hope it helps

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @SGaist nevermind it does change with fractional values, like 0.6, I just had it saved as an int but needed to convert it into a double.

          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