代码:
//连接spinbox和slider
connect(ui->spinBox, SIGNAL(valueChanged(double)), this, SLOT(slotDoubleSpinbox_slider()));
connect(ui->value_Slider, SIGNAL(valueChanged(int)), this, SLOT(slotslider_DoubleSpinBox()));
信号槽:
//函数实现
void HamamatsuCam::slotDoubleSpinbox_slider()
{
ui->value_Slider->setValue((int)(ui->spinBox->value()*1.00));
}
void HamamatsuCam::slotslider_DoubleSpinBox()
{
ui->spinBox->setValue((double)(ui->value_Slider->value())/1.00);
}