QSlider setting a certain increment



  • 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?


  • Lifetime Qt Champion

    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



  • @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.



  • @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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.