From 1253697801fc7f7879d33279e170cbef1ea4e5a9 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Fri, 31 Jul 2026 20:33:20 -0400 Subject: [PATCH] gui: Explicitly call QSlider::setRange in LogSlider constructor cppcheck identified that LogSlider::LogSlider() calls the derived setRange(double, double) overload instead of QSlider::setRange(int, int) due to C++ name hiding. The constructor's call to: setRange(0, 1000); was therefore invoking the logarithmic range implementation with min == 0.0, resulting in a call to log10(0). While most callers immediately replace the initial state by calling LogSlider::setRange() with a valid positive range, the constructor still performs an invalid mathematical operation during initialization. Explicitly qualify the call as QSlider::setRange(0, 1000) to initialize the underlying slider without invoking the logarithmic overload. This eliminates the invalid-domain call, avoids undefined behavior from propagating exceptional floating-point values into the slider state, and makes the constructor's intent explicit. This change has no functional impact on normal operation, but removes a latent initialization bug and prevents future regressions caused by overload hiding. Signed-off-by: Robin Getz --- sdrgui/gui/logslider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdrgui/gui/logslider.cpp b/sdrgui/gui/logslider.cpp index cf66d17a7..d6363a411 100644 --- a/sdrgui/gui/logslider.cpp +++ b/sdrgui/gui/logslider.cpp @@ -30,7 +30,7 @@ LogSlider::LogSlider(QWidget *parent) : QSlider(Qt::Horizontal, parent) { - setRange(0, 1000); + QSlider::setRange(0, 1000); connect(this, &QSlider::valueChanged, this, &LogSlider::handleValueChanged); setPageStep(1); setTickPosition(QSlider::TicksAbove);