+ fixes #0001562: Add units to Fillet and Chamfer in PartDesign
This commit is contained in:
parent
f867733499
commit
8923810e1d
|
@ -57,7 +57,7 @@ TaskChamferParameters::TaskChamferParameters(ViewProviderChamfer *ChamferView,QW
|
|||
ui->setupUi(proxy);
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
connect(ui->doubleSpinBox, SIGNAL(valueChanged(double)),
|
||||
connect(ui->chamferDistance, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onLengthChanged(double)));
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
@ -65,11 +65,10 @@ TaskChamferParameters::TaskChamferParameters(ViewProviderChamfer *ChamferView,QW
|
|||
PartDesign::Chamfer* pcChamfer = static_cast<PartDesign::Chamfer*>(ChamferView->getObject());
|
||||
double r = pcChamfer->Size.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setMaximum(INT_MAX);
|
||||
ui->doubleSpinBox->setValue(r);
|
||||
ui->doubleSpinBox->selectAll();
|
||||
QMetaObject::invokeMethod(ui->doubleSpinBox, "setFocus", Qt::QueuedConnection);
|
||||
ui->chamferDistance->setUnit(Base::Unit::Length);
|
||||
ui->chamferDistance->setValue(r);
|
||||
ui->chamferDistance->selectNumber();
|
||||
QMetaObject::invokeMethod(ui->chamferDistance, "setFocus", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void TaskChamferParameters::onLengthChanged(double len)
|
||||
|
@ -81,10 +80,9 @@ void TaskChamferParameters::onLengthChanged(double len)
|
|||
|
||||
double TaskChamferParameters::getLength(void) const
|
||||
{
|
||||
return ui->doubleSpinBox->value();
|
||||
return ui->chamferDistance->getQuantity().getValue();
|
||||
}
|
||||
|
||||
|
||||
TaskChamferParameters::~TaskChamferParameters()
|
||||
{
|
||||
delete ui;
|
||||
|
|
|
@ -24,19 +24,19 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox">
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Gui::InputField" name="chamferDistance"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::InputField</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>Gui/InputField.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in New Issue
Block a user