Set single step depend on measurement unit.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-06-21 13:53:33 +03:00
parent ed6c72bda9
commit b7d62d3dbe
2 changed files with 16 additions and 1 deletions

View File

@ -2918,18 +2918,33 @@ void TMainWindow::SetDecimals()
{ {
case Unit::Cm: case Unit::Cm:
ui->doubleSpinBoxBaseValue->setDecimals(1); ui->doubleSpinBoxBaseValue->setDecimals(1);
ui->doubleSpinBoxBaseValue->setSingleStep(0.1);
ui->doubleSpinBoxInSizes->setDecimals(1); ui->doubleSpinBoxInSizes->setDecimals(1);
ui->doubleSpinBoxInSizes->setSingleStep(0.1);
ui->doubleSpinBoxInHeights->setDecimals(1); ui->doubleSpinBoxInHeights->setDecimals(1);
ui->doubleSpinBoxInHeights->setSingleStep(0.1);
break; break;
case Unit::Mm: case Unit::Mm:
ui->doubleSpinBoxBaseValue->setDecimals(0); ui->doubleSpinBoxBaseValue->setDecimals(0);
ui->doubleSpinBoxBaseValue->setSingleStep(1);
ui->doubleSpinBoxInSizes->setDecimals(0); ui->doubleSpinBoxInSizes->setDecimals(0);
ui->doubleSpinBoxInSizes->setSingleStep(1);
ui->doubleSpinBoxInHeights->setDecimals(0); ui->doubleSpinBoxInHeights->setDecimals(0);
ui->doubleSpinBoxInHeights->setSingleStep(1);
break; break;
case Unit::Inch: case Unit::Inch:
ui->doubleSpinBoxBaseValue->setDecimals(5); ui->doubleSpinBoxBaseValue->setDecimals(5);
ui->doubleSpinBoxBaseValue->setSingleStep(0.00001);
ui->doubleSpinBoxInSizes->setDecimals(5); ui->doubleSpinBoxInSizes->setDecimals(5);
ui->doubleSpinBoxInSizes->setSingleStep(0.00001);
ui->doubleSpinBoxInHeights->setDecimals(5); ui->doubleSpinBoxInHeights->setDecimals(5);
ui->doubleSpinBoxInHeights->setSingleStep(0.00001);
break; break;
default: default:
break; break;

View File

@ -47,7 +47,7 @@
<string/> <string/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tabMeasurements"> <widget class="QWidget" name="tabMeasurements">
<attribute name="icon"> <attribute name="icon">