Unsolved Set value to QSlide
-
I'm using a library to play videos and the library gives me the length of the video as integer and the position as float, but the thing is, the length it gives is for example, a 1m video is
60000
in ms, but the current position is from0.0
to1
, like:0.00333333
0.00791667
0.0125167
0.0170833
0.0216667
0.02585
0.0304333
0.0350167
0.0396
0.0441667
0.04835
0.0529333
0.0575167I set the range for the
QSlider
as the length of the video divided by1000.0
that is60
but now I don't know how to supply the value based on the float0.1
to1
.What can I do?
-
just multiply the "float" by the maximum of the slider (assuming the slider has a minimum of 0)
The general forumla is slider minimum + ( float* (slider maximum-slider minimum))