Problems creating a Slider
Hi to all,
I having some problems in creating a slider.
IOn brief this is the code I wrote:
Code:
// range between 0.0 = silent and 1.0 = full volume
slider->setRange(0, 10);
slider->setSingleStep(0.2f); //doesn't work. I only have 10 tick
slider->setPageStep(1);
slider->setTickInterval(1);
slider
->setTickPosition
(QSlider::TicksRight);
slider->setValue(5);
I would have a range between 0 and 1 (float) so I divide /10
Seems that the slider is discrete. I would have a fluid cursor movement. Is possible?
I also would have more that 10 tick between the 2 ranges [0-10]. How can I do it?
A last question: I don't understand very well the pageStep property. What does mean?
Regards,
Franco
Re: Problems creating a Slider
You can setRange(0, 50), setSingleStep(1) and divide by 50 instead of 10 to get the step size of 0.02.
To make the step even smaller you can setRange(0,1000), setSingleStep(1) and divide by 1000.
pageStep defines how much internal counter changes when PgUp/PgDown are pressed.
Quote:
pageStep : int
This property holds the page step.
The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown.
Re: Problems creating a Slider
Thank you.
It works. And it's possible to don't show the ticks?
Best,
Franco
Re: Problems creating a Slider
Sorry for the last post.
I didn't see the QSlider::setTicksPositio(NoTicks);
Regards,
Franco