QSlider mouse direct jump

后端 未结 12 1776
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-23 16:27

Instead of stepping when the user clicks somewhere on the qslider I want to make the slider jump to that position. How can this be implemented ?

12条回答
  •  一向
    一向 (楼主)
    2020-12-23 17:14

    A simple method would be to derive from QSlider and reimplement mousePressEvent(....) to set the marker position using setSliderPosition(int).

提交回复
热议问题