franco.amato
30th September 2008, 19:56
Hi to all,
I having some problems in creating a slider.
IOn brief this is the code I wrote:
QSlider *slider = new QSlider(Qt::Vertical);
// 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
I having some problems in creating a slider.
IOn brief this is the code I wrote:
QSlider *slider = new QSlider(Qt::Vertical);
// 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