QSlider and QDoubleSpinBox use different types of arguments in valueChanged/ setValue(QSlider uses ints, and QDoubleSpinBox uses, of course, doubles). Changing the argument type for the slider and slot signal can help:
connect(spinBox1, SIGNAL(valueChanged(double)),horizontalSlider1,SLOT(setValue(int)) );
connect(horizontalSlider1,SIGNAL(valueChanged(int)),spinBox1,SLOT(setValue(double)) );
I'm not sure Qt can automatically handle this type conversion for you; if not, you will need to define your own slots to call setValue () on the correct object
source
share