From 8d10ff52346c99ad8ded2fdc23c921ae8e0e8970 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 23 May 2017 10:45:04 +0300 Subject: [PATCH] Fixed issue #688. Difficult to enter numbers in Tape. (grafted from 4c3cac37331437d3a6e9764d38351156c82fd731) --HG-- branch : develop --- ChangeLog.txt | 1 + src/app/tape/tmainwindow.cpp | 21 +++++++++++++++------ src/app/tape/tmainwindow.h | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index ef27af10e..50c77040e 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,6 +8,7 @@ - [#686] Seam allowance not placed correctly. - [#687] Wrong seam allowance. - [#689] Grainline default values swapped around. +- [#688] Difficult to enter numbers in Tape. # Version 0.5.0 May 9, 2017 - [#581] User can now filter input lists by keyword in function wizard. diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index eedf8d01c..4151e8305 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1435,6 +1435,12 @@ void TMainWindow::ChangedHeight(const QString &text) //--------------------------------------------------------------------------------------------------------------------- void TMainWindow::ShowMData() +{ + ShowNewMData(true); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TMainWindow::ShowNewMData(bool fresh) { if (ui->tableWidget->rowCount() > 0) { @@ -1487,9 +1493,12 @@ void TMainWindow::ShowMData() const qreal value = UnitConvertor(data->GetTableValue(meash->GetName(), mType), mUnit, pUnit); ui->labelCalculatedValue->setText(qApp->LocaleToString(value) + " " +postfix); - ui->doubleSpinBoxBaseValue->setValue(meash->GetBase()); - ui->doubleSpinBoxInSizes->setValue(meash->GetKsize()); - ui->doubleSpinBoxInHeights->setValue(meash->GetKheight()); + if (fresh) + { + ui->doubleSpinBoxBaseValue->setValue(meash->GetBase()); + ui->doubleSpinBoxInSizes->setValue(meash->GetKsize()); + ui->doubleSpinBoxInHeights->setValue(meash->GetKheight()); + } ui->labelCalculatedValue->blockSignals(false); ui->doubleSpinBoxBaseValue->blockSignals(false); @@ -1740,7 +1749,7 @@ void TMainWindow::SaveMBaseValue(double value) ui->tableWidget->selectRow(row); ui->tableWidget->blockSignals(false); - ShowMData(); + ShowNewMData(false); } //--------------------------------------------------------------------------------------------------------------------- @@ -1765,7 +1774,7 @@ void TMainWindow::SaveMSizeIncrease(double value) ui->tableWidget->selectRow(row); ui->tableWidget->blockSignals(false); - ShowMData(); + ShowNewMData(false); } //--------------------------------------------------------------------------------------------------------------------- @@ -1790,7 +1799,7 @@ void TMainWindow::SaveMHeightIncrease(double value) ui->tableWidget->selectRow(row); ui->tableWidget->blockSignals(false); - ShowMData(); + ShowNewMData(false); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h index fb2aeab6a..3f635c505 100644 --- a/src/app/tape/tmainwindow.h +++ b/src/app/tape/tmainwindow.h @@ -162,6 +162,7 @@ private: void InitComboBoxUnits(); void InitGender(QComboBox *gender); + void ShowNewMData(bool fresh); void ShowUnits(); void ShowHeaderUnits(QTableWidget *table, int column, const QString &unit); void UpdateRecentFileActions();