SliderPlusBox: Can change slider max value

This commit is contained in:
2026-01-31 22:40:45 +01:00
parent f05cd92a6e
commit bbcd29cba9
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -14,6 +14,10 @@ SliderPlusBox::SliderPlusBox(double min, double max, double step, int decimals,
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Minimum value must be greater than zero for logarithmic scale");
if (m_max <= m_min)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Maximum value must be greater than minimum");
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
@@ -117,6 +121,14 @@ void SliderPlusBox::setValue(double value) {
m_doubleSpinBox->setValue(value);
}
void SliderPlusBox::setMax(double value) {
if (value <= m_min)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Maximum value must be greater than minimum");
m_max = value;
updateSliderRange();
}
void SliderPlusBox::setScaleType(ScaleType type) {
if (m_scaleType == type)
return;
+1
View File
@@ -43,6 +43,7 @@ public:
double value() const { return v; }
void setScaleType(ScaleType type);
ScaleType scaleType() const { return m_scaleType; }
void setMax(double max);
signals:
void valueChanged(double value);