How to connect a QSlider to QDoubleSpinBox

后端 未结 5 1255
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 06:29

I want to connect a QSlider to a QDoubleSpinBox but while the code compiles fine and runs for simple QSpinBox, it doesn\'t work for QDoubleSpinBox

QSlider *h         


        
5条回答
  •  滥情空心
    2021-01-13 06:54

    As Dave Kilian answered, the signals and slots for QSlider don't use double. Also, Qt 4 does not automatically convert the types; it will not allow you to connect them. So, you will have to write your own conversion slot which updates the value of the other item.

提交回复
热议问题