PDA

View Full Version : QSlider



mickey
16th March 2006, 19:57
Hi,
there is a way to set the step of a slider float? Thanks

krsmichael
16th March 2006, 20:25
Your question is a bit vague, but I assume you want the slider to step in discrete increments. In that case, set max value to something less than the physical pixel attributes of your slider. For example, if your slider is 100 pixels wide and you set the max value to 7, the slider is going to use discrete increments.

So you slider represents a value from 0 to 100. You could set the max value of your slider to 10 and each value would be multiplied by 10 to get your value.

M

mickey
16th March 2006, 21:29
I need set step of slider to eg. 0.01; when Igo on to next position of slider its value jum to 0.02; it is connected to a lcd (that should be show 0.01, 0.02 but in this moment I don't know to do this...)....Any hints?

narendra
27th November 2009, 09:44
I am also struck at the problem.
Can any one help me?

bunjee
27th November 2009, 16:55
I need set step of slider to eg. 0.01; when Igo on to next position of slider its value jum to 0.02; it is connected to a lcd (that should be show 0.01, 0.02 but in this moment I don't know to do this...)....Any hints?

Can't you set an interval of 0 and 100 and divide it before displaying it ?

scascio
27th November 2009, 17:21
You need to do the conversion from integer values to float yourself in order to interpret slider position as floating numbers.

But since you want to connect SIGNAL and SLOTS direclty in float, a way is to create your own slider widget.