Solved Vertical slider increment
-
Hello guys,
i want to use a vertical slider to increase a variable
void MainWindow::on_verticalSlider_sliderMoved(int position) { ui->verticalSlider->setRange(1,50); }
i have already got this, but i don't know how to increment a variable when the slider moove
thanks
-
Hi,
Do you mean connect a slot to the
sliderMoved
signal of your verticalSlider object and call something like++myVariable;
in it ? -
Yes that is right
-
Since it's the same slider then you can add the logic to your on_verticalSlider_sliderMoved slot.
-
so just that :
void MainWindow::on_verticalSlider_sliderMoved(int position) { ui->verticalSlider->setRange(1,50); z++; }
?
-
From what you described, yes.
-
Okay it works :-)
Thank you !