I am trying to get float values from a QSlider, but the problem is the QSlider only supports integers... and each slide can only support integer values too. I need float/double values. Is there an alternative for this?
Here's a simple solution but does not work too. I tried setting my QSlider's minimum and maximum values to -1000 and 1000 so that I can just divide the integer values by 1000 again to get float values in the end. But all I get are zero values. What's wrong ?
Dragging the slider to the minimum I getQt Code:
qDebug("Slider val: %.30lf", (float) (value / 1000));To copy to clipboard, switch view to plain text mode
Slider val: -1.000000000000000000000000000000
Dragging the slider to the maximum I get
Slider val: 1.000000000000000000000000000000
but all values in the middle of maximum and minimum I get
Slider val: 0.000000000000000000000000000000
Bookmarks