+ fixes #0001562: Add units to Fillet and Chamfer in PartDesign
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user