[Part] Section Cut: fix for tooltip handling

This commit is contained in:
Uwe
2022-03-09 01:52:16 +01:00
parent 9e91a8991e
commit e3e455cd5c

View File

@@ -755,12 +755,14 @@ void SectionCut::CutValueHelper(double value, QDoubleSpinBox* SpinBox, QSlider*
}
// update slider position and tooltip
// the slider value is % of the cut range
Slider->blockSignals(true);
Slider->setValue(
int((value - SpinBox->minimum())
/ (SpinBox->maximum() - SpinBox->minimum()) * 100.0));
Slider->setToolTip(QString::number(value, 'g', Base::UnitsApi::getDecimals()));
Slider->blockSignals(false);
if (Slider->isEnabled()) {
Slider->blockSignals(true);
Slider->setValue(
int((value - SpinBox->minimum())
/ (SpinBox->maximum() - SpinBox->minimum()) * 100.0));
Slider->setToolTip(QString::number(value, 'g', Base::UnitsApi::getDecimals()));
Slider->blockSignals(false);
}
// we cannot cut to the edge because then the result is an empty shape
// we chose purposely not to simply set the range for cutX previously