Skip to content
Snippets Groups Projects
Commit 2b1c0d77 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

clang-format

parent 8e11c9cb
No related branches found
No related tags found
1 merge request!2205rewrite DoubleSpinBox; use DoubleSpinBox for intensity; simplify RealLimits (#870)
...@@ -28,7 +28,7 @@ QString toString(double val, int decimal_points = 4) // TODO merge with other to ...@@ -28,7 +28,7 @@ QString toString(double val, int decimal_points = 4) // TODO merge with other to
return "0"; return "0";
QString result = (val >= 10000 || val < 0.1) ? QString::number(val, 'e', decimal_points) QString result = (val >= 10000 || val < 0.1) ? QString::number(val, 'e', decimal_points)
: QString::number(val, 'f', decimal_points); : QString::number(val, 'f', decimal_points);
// suppress ".0" in mantissa; normalize exponent // suppress ".0" in mantissa; normalize exponent
return result.replace(QRegularExpression("(\\.?0+)?((e)([\\+]?)([-]?)(0*)([1-9].*))?$"), return result.replace(QRegularExpression("(\\.?0+)?((e)([\\+]?)([-]?)(0*)([1-9].*))?$"),
...@@ -71,11 +71,10 @@ void DoubleSpinBox::wheelEvent(QWheelEvent* event) ...@@ -71,11 +71,10 @@ void DoubleSpinBox::wheelEvent(QWheelEvent* event)
void DoubleSpinBox::stepBy(int steps) void DoubleSpinBox::stepBy(int steps)
{ {
if (steps>0) if (steps > 0)
setValue(m_valueProperty * 1.2); setValue(m_valueProperty * 1.2);
else else
setValue(m_valueProperty / 1.2); setValue(m_valueProperty / 1.2);
} }
void DoubleSpinBox::onDisplayValueChanged() void DoubleSpinBox::onDisplayValueChanged()
......
...@@ -43,7 +43,9 @@ signals: ...@@ -43,7 +43,9 @@ signals:
private: private:
QAbstractSpinBox::StepEnabled stepEnabled() const override QAbstractSpinBox::StepEnabled stepEnabled() const override
{ return StepUpEnabled | StepDownEnabled; } {
return StepUpEnabled | StepDownEnabled;
}
void setValue(double val); void setValue(double val);
void wheelEvent(QWheelEvent* event) override; void wheelEvent(QWheelEvent* event) override;
void stepBy(int steps) override; void stepBy(int steps) override;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment