From 56468e991771ec6cfab50293167c1d9eaeeda831 Mon Sep 17 00:00:00 2001 From: Chris Esposito Date: Mon, 17 Sep 2018 19:12:07 +1000 Subject: [PATCH] espospinbox does not change value until enter is pressed. scoperangeenterdialog supports changeStepping() --- Desktop_Interface/scoperangeenterdialog.cpp | 6 ++++++ Desktop_Interface/ui_elements/espospinbox.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Desktop_Interface/scoperangeenterdialog.cpp b/Desktop_Interface/scoperangeenterdialog.cpp index b30013be..c6cd00c6 100644 --- a/Desktop_Interface/scoperangeenterdialog.cpp +++ b/Desktop_Interface/scoperangeenterdialog.cpp @@ -14,6 +14,12 @@ scopeRangeEnterDialog::scopeRangeEnterDialog(QWidget *parent, bool buttonVisible ui->vMinBox->setValue(yBot); ui->timeWindowBox->setValue(window); ui->buttonBox->setVisible(buttonVisible); + + for (espoSpinBox* spinBox : {ui->vMaxBox, ui->vMinBox, ui->timeWindowBox, ui->delayBox}) + { + spinBox->changeStepping(spinBox->value()); + connect(spinBox, SIGNAL(valueChanged(double)), spinBox, SLOT(changeStepping(double))); + } } scopeRangeEnterDialog::~scopeRangeEnterDialog() diff --git a/Desktop_Interface/ui_elements/espospinbox.cpp b/Desktop_Interface/ui_elements/espospinbox.cpp index 9e90ef13..128d9db2 100644 --- a/Desktop_Interface/ui_elements/espospinbox.cpp +++ b/Desktop_Interface/ui_elements/espospinbox.cpp @@ -2,6 +2,7 @@ espoSpinBox::espoSpinBox(QWidget *parent) : QDoubleSpinBox(parent) { + setKeyboardTracking(false); //connect(this, SIGNAL(valueChanged(double)), this, SLOT(changeStepping(double))); } @@ -63,6 +64,7 @@ void espoSpinBox::changeStepping(double value){ QValidator::State espoSpinBox::validate(QString& text, int& pos) const { + qDebug() << pos; prefixLength = pos; return QValidator::State::Acceptable; }