SliderSlider: Rename `value to new_value`

This commit is contained in:
Jonas Kvinge
2023-01-03 19:53:35 +01:00
parent 4ec028e736
commit 286b908062
2 changed files with 7 additions and 7 deletions

View File

@@ -39,21 +39,21 @@ SliderSlider::SliderSlider(const Qt::Orientation orientation, QWidget *parent, c
} }
void SliderSlider::SetValue(const uint value) { void SliderSlider::SetValue(const uint new_value) {
setValue(static_cast<int>(value)); setValue(static_cast<int>(new_value));
} }
void SliderSlider::setValue(int value) { void SliderSlider::setValue(int new_value) {
// Don't adjust the slider while the user is dragging it! // Don't adjust the slider while the user is dragging it!
if ((!sliding_ || outside_) && !wheeling_) { if ((!sliding_ || outside_) && !wheeling_) {
QSlider::setValue(adjustValue(value)); QSlider::setValue(adjustValue(new_value));
} }
else { else {
prev_value_ = value; prev_value_ = new_value;
} }
} }

View File

@@ -37,8 +37,8 @@ class SliderSlider : public QSlider {
// WARNING non-virtual - and thus only really intended for internal use this is a major flaw in the class presently, however it suits our current needs fine // WARNING non-virtual - and thus only really intended for internal use this is a major flaw in the class presently, however it suits our current needs fine
int value() const { return adjustValue(QSlider::value()); } int value() const { return adjustValue(QSlider::value()); }
virtual void SetValue(const uint value); virtual void SetValue(const uint new_value);
virtual void setValue(int value); virtual void setValue(int new_value);
signals: signals:
// We emit this when the user has specifically changed the slider so connect to it if valueChanged() is too generic Qt also emits valueChanged(int) // We emit this when the user has specifically changed the slider so connect to it if valueChanged() is too generic Qt also emits valueChanged(int)