+ fixes 0001563: Add units to Linear Pattern in PartDesign

This commit is contained in:
wmayer 2014-07-22 10:39:44 +02:00
parent b5b929cf58
commit d2cbd6817f
2 changed files with 14 additions and 8 deletions

View File

@ -129,9 +129,11 @@ void TaskLinearPatternParameters::setupUI()
ui->comboDirection->setEnabled(true);
ui->checkReverse->setEnabled(true);
ui->spinLength->blockSignals(true);
ui->spinLength->setEnabled(true);
ui->spinLength->setUnit(Base::Unit::Length);
ui->spinLength->blockSignals(false);
ui->spinOccurrences->setEnabled(true);
ui->spinLength->setDecimals(Base::UnitsApi::getDecimals());
updateUI();
}
@ -370,7 +372,7 @@ const bool TaskLinearPatternParameters::getReverse(void) const
const double TaskLinearPatternParameters::getLength(void) const
{
return ui->spinLength->value();
return ui->spinLength->value().getValue();
}
const unsigned TaskLinearPatternParameters::getOccurrences(void) const

View File

@ -75,12 +75,9 @@
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinLength">
<property name="decimals">
<number>3</number>
</property>
<property name="maximum">
<double>999999.000000000000000</double>
<widget class="Gui::QuantitySpinBox" name="spinLength">
<property name="unit" stdset="0">
<string>mm</string>
</property>
<property name="value">
<double>100.000000000000000</double>
@ -146,6 +143,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>