3

i am stuck at trying to reverse the range of a QSlider such that abs(maxVal) always stays on top.

slider->setRange[0,maxVal] should look like the slider on the right

slider->setRange[-maxVal,0] should be reversed/rotated.

enter image description here

What i could do is not to reverse the range, set a "-" prefix in the SpinBox above and multiply the value by -1 when reading. I just wonder if there is the possibility to swap the direction of the slider.

p-a-o-l-o
  • 9,807
  • 2
  • 22
  • 35
jonnyx
  • 345
  • 2
  • 16

1 Answers1

5

You should be able to invert the slider, setting the invertedAppearance property to true:

slider->setRange(-maxVal, 0); 
slider->setInvertedAppearance(true);
p-a-o-l-o
  • 9,807
  • 2
  • 22
  • 35