Qt: fix setting of spinbox values when modifying shader parameter sliders

This commit is contained in:
Brad Parker 2018-08-14 21:38:45 -04:00
parent 560149857b
commit 553394c266

View File

@ -1340,31 +1340,6 @@ void MainWindow::onShaderParamSliderValueChanged(int value)
return;
spinBoxVariant = slider->property("spinBox");
if (spinBoxVariant.isValid())
{
QSpinBox *spinBox = spinBoxVariant.value<QSpinBox*>();
if (!spinBox)
return;
spinBox->blockSignals(true);
spinBox->setValue(slider->value());
spinBox->blockSignals(false);
}
else
{
QVariant doubleSpinBoxVariant = slider->property("doubleSpinBox");
QDoubleSpinBox *doubleSpinBox = doubleSpinBoxVariant.value<QDoubleSpinBox*>();
if (!doubleSpinBox)
return;
doubleSpinBox->blockSignals(true);
doubleSpinBox->setValue(slider->value());
doubleSpinBox->blockSignals(false);
}
paramVariant = slider->property("param");
if (paramVariant.isValid())
@ -1377,6 +1352,30 @@ void MainWindow::onShaderParamSliderValueChanged(int value)
param->current = newValue;
}
}
if (spinBoxVariant.isValid())
{
QSpinBox *spinBox = spinBoxVariant.value<QSpinBox*>();
if (!spinBox)
return;
spinBox->blockSignals(true);
spinBox->setValue(newValue);
spinBox->blockSignals(false);
}
else
{
QVariant doubleSpinBoxVariant = slider->property("doubleSpinBox");
QDoubleSpinBox *doubleSpinBox = doubleSpinBoxVariant.value<QDoubleSpinBox*>();
if (!doubleSpinBox)
return;
doubleSpinBox->blockSignals(true);
doubleSpinBox->setValue(newValue);
doubleSpinBox->blockSignals(false);
}
}
void MainWindow::onShaderParamSpinBoxValueChanged(int value)