From cd15fd711edf1f3c536790bc748802ba3980a04f Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sat, 28 Nov 2015 22:48:43 +0200 Subject: [PATCH 1/2] Resolved issue #80. Choice between inches and centimeters in options --HG-- branch : feature --- src/libs/vtools/dialogs/tools/dialogdetail.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 2d75a9443..04ea97221 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -54,6 +54,10 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit())); + if(qApp->patternUnit() == Unit::Inch) + { + ui.doubleSpinBoxSeams->setDecimals(5); + } bOk = ui.buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr); From f91fbaaa01f1d9d7e4413ed8374b03ab6695e91e Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sun, 29 Nov 2015 16:42:39 +0200 Subject: [PATCH 2/2] We need do set decimals before we set value --HG-- branch : feature --- src/libs/vtools/dialogs/tools/dialogdetail.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp index 04ea97221..c4c4c9829 100644 --- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp +++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp @@ -52,12 +52,12 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge ui.labelUnitX->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true)); - // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. - ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit())); if(qApp->patternUnit() == Unit::Inch) { ui.doubleSpinBoxSeams->setDecimals(5); } + // Default value for seam allowence is 1 cm. But pattern have different units, so just set 1 in dialog not enough. + ui.doubleSpinBoxSeams->setValue(UnitConvertor(1, Unit::Cm, qApp->patternUnit())); bOk = ui.buttonBox->button(QDialogButtonBox::Ok); SCASSERT(bOk != nullptr);