summaryrefslogtreecommitdiffstats
path: root/src/widget/wbeatspinbox.cpp
diff options
context:
space:
mode:
authorbe_ <be.0@gmx.com>2017-03-23 22:24:06 -0500
committerbe_ <be.0@gmx.com>2017-03-23 22:24:06 -0500
commit241da8a947518c18ee65f7a5baccb3944df8951f (patch)
tree11015df8c4f2d1d604fbc0f0bcfe53cb763144d9 /src/widget/wbeatspinbox.cpp
parente99296622dd0500b9cc3ed9fae957b0842449e41 (diff)
don't let WBeatSpinBox's value get out of sync with its ControlObject
Diffstat (limited to 'src/widget/wbeatspinbox.cpp')
-rw-r--r--src/widget/wbeatspinbox.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/widget/wbeatspinbox.cpp b/src/widget/wbeatspinbox.cpp
index e270e33e4c..522fb82acc 100644
--- a/src/widget/wbeatspinbox.cpp
+++ b/src/widget/wbeatspinbox.cpp
@@ -6,10 +6,8 @@
QRegExp WBeatSpinBox::s_regexpBlacklist("[^0-9./ ]");
-WBeatSpinBox::WBeatSpinBox(QWidget * parent,
- ControlObject* pValueControl,
- int decimals,
- double minimum, double maximum)
+WBeatSpinBox::WBeatSpinBox(QWidget * parent, ControlObject* pValueControl,
+ int decimals, double minimum, double maximum)
: WBaseWidget(parent),
m_valueControl(
pValueControl ?
@@ -22,9 +20,6 @@ WBeatSpinBox::WBeatSpinBox(QWidget * parent,
// to avoid interfering with using the library via keyboard.
setFocusPolicy(Qt::ClickFocus);
- connect(this, SIGNAL(valueChanged(double)),
- this, SLOT(slotSpinboxValueChanged(double)));
-
setValue(m_valueControl.get());
m_valueControl.connectValueChanged(SLOT(slotControlValueChanged(double)));
}
@@ -36,10 +31,8 @@ void WBeatSpinBox::stepBy(int steps) {
} else if (newValue > maximum()) {
newValue = maximum();
}
- setValue(newValue);
-}
-
-void WBeatSpinBox::slotSpinboxValueChanged(double newValue) {
+ // Do not call QDoubleSpinBox::setValue directly in case
+ // the new value of the ControlObject needs to be confirmed.
m_valueControl.set(newValue);
}