QSlider mouse direct jump

后端 未结 12 1796
爱一瞬间的悲伤
爱一瞬间的悲伤 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:04

    I think,

    the QStyle::sliderValueFromPosition() function can be used.

    http://qt-project.org/doc/qt-5/qstyle.html#sliderValueFromPosition

提交回复
热议问题