From 7785d7fc9c107973e3aac1dfdc033fe256886b42 Mon Sep 17 00:00:00 2001 From: Seeker4 Date: Thu, 25 Jul 2019 06:23:24 -0700 Subject: [PATCH] Change height and weight decimals displayed, BMI digits displayed --- oscar/daily.cpp | 8 ++++---- oscar/daily.ui | 2 +- oscar/newprofile.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/oscar/daily.cpp b/oscar/daily.cpp index 6863609a..ee2181d8 100644 --- a/oscar/daily.cpp +++ b/oscar/daily.cpp @@ -432,7 +432,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared) ui->ouncesSpinBox->setSuffix(STR_UNIT_OUNCE); } else { ui->ouncesSpinBox->setVisible(false); - ui->weightSpinBox->setDecimals(3); + ui->weightSpinBox->setDecimals(1); ui->weightSpinBox->setSuffix(STR_UNIT_KG); } @@ -835,7 +835,7 @@ void Daily::on_ReloadDay() ui->ouncesSpinBox->setSuffix(STR_UNIT_OUNCE); } else { ui->ouncesSpinBox->setVisible(false); - ui->weightSpinBox->setDecimals(3); + ui->weightSpinBox->setDecimals(1); ui->weightSpinBox->setSuffix(STR_UNIT_KG); } this->setCursor(Qt::ArrowCursor); @@ -1693,7 +1693,7 @@ void Daily::Load(QDate date) double kg=journal->settings[Journal_Weight].toDouble(&ok); if (p_profile->general->unitSystem()==US_Metric) { - ui->weightSpinBox->setDecimals(3); + ui->weightSpinBox->setDecimals(1); ui->weightSpinBox->blockSignals(true); ui->weightSpinBox->setValue(kg); ui->weightSpinBox->blockSignals(false); @@ -1783,7 +1783,7 @@ void Daily::UnitsChanged() } else { kg=(ui->weightSpinBox->value()*(ounce_convert*16.0))+(ui->ouncesSpinBox->value()*ounce_convert); kg/=1000.0; - ui->weightSpinBox->setDecimals(3); + ui->weightSpinBox->setDecimals(1); ui->weightSpinBox->setValue(kg); ui->ouncesSpinBox->setVisible(false); ui->weightSpinBox->setSuffix(STR_UNIT_KG); diff --git a/oscar/daily.ui b/oscar/daily.ui index fa96e948..1fc521e5 100644 --- a/oscar/daily.ui +++ b/oscar/daily.ui @@ -1320,7 +1320,7 @@ QSlider::handle:horizontal { false - 5 + 4 QLCDNumber::Flat diff --git a/oscar/newprofile.cpp b/oscar/newprofile.cpp index e2a1a8cb..392ae76a 100644 --- a/oscar/newprofile.cpp +++ b/oscar/newprofile.cpp @@ -48,7 +48,7 @@ NewProfile::NewProfile(QWidget *parent, const QString *user) : on_cpapModeCombo_activated(0); m_passwordHashed = false; ui->heightEdit2->setVisible(false); - ui->heightEdit->setDecimals(2); + ui->heightEdit->setDecimals(0); ui->heightEdit->setSuffix(STR_UNIT_CM); { @@ -397,7 +397,7 @@ void NewProfile::edit(const QString name) } else { // good wholesome metric ui->heightEdit->setValue(v); ui->heightEdit2->setVisible(false); - ui->heightEdit->setDecimals(2); + ui->heightEdit->setDecimals(0); ui->heightEdit->setSuffix(STR_UNIT_CM); } } @@ -417,7 +417,7 @@ void NewProfile::on_heightCombo_currentIndexChanged(int index) if (index == 0) { //metric ui->heightEdit2->setVisible(false); - ui->heightEdit->setDecimals(2); + ui->heightEdit->setDecimals(0); ui->heightEdit->setSuffix(STR_UNIT_CM); double v = ui->heightEdit->value() * 30.48; v += ui->heightEdit2->value() * 2.54;