+ support units in draft panel
This commit is contained in:
parent
3585403ee2
commit
57cdb8aed5
|
@ -60,7 +60,7 @@ TaskDraftParameters::TaskDraftParameters(ViewProviderDraft *DraftView,QWidget *p
|
|||
ui->setupUi(proxy);
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
connect(ui->doubleSpinBox, SIGNAL(valueChanged(double)),
|
||||
connect(ui->draftAngle, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onAngleChanged(double)));
|
||||
connect(ui->checkReverse, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onReversedChanged(bool)));
|
||||
|
@ -78,12 +78,11 @@ TaskDraftParameters::TaskDraftParameters(ViewProviderDraft *DraftView,QWidget *p
|
|||
PartDesign::Draft* pcDraft = static_cast<PartDesign::Draft*>(DraftView->getObject());
|
||||
double a = pcDraft->Angle.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setMinimum(0.0);
|
||||
ui->doubleSpinBox->setMaximum(89.99);
|
||||
ui->doubleSpinBox->setValue(a);
|
||||
ui->doubleSpinBox->selectAll();
|
||||
QMetaObject::invokeMethod(ui->doubleSpinBox, "setFocus", Qt::QueuedConnection);
|
||||
ui->draftAngle->setMinimum(0.0);
|
||||
ui->draftAngle->setMaximum(89.99);
|
||||
ui->draftAngle->setValue(a);
|
||||
ui->draftAngle->selectAll();
|
||||
QMetaObject::invokeMethod(ui->draftAngle, "setFocus", Qt::QueuedConnection);
|
||||
|
||||
bool r = pcDraft->Reversed.getValue();
|
||||
ui->checkReverse->setChecked(r);
|
||||
|
@ -295,7 +294,7 @@ void TaskDraftParameters::onAngleChanged(double angle)
|
|||
|
||||
const double TaskDraftParameters::getAngle(void) const
|
||||
{
|
||||
return ui->doubleSpinBox->value();
|
||||
return ui->draftAngle->value().getValue();
|
||||
}
|
||||
|
||||
void TaskDraftParameters::onReversedChanged(const bool on) {
|
||||
|
@ -360,7 +359,11 @@ TaskDlgDraftParameters::~TaskDlgDraftParameters()
|
|||
|
||||
void TaskDlgDraftParameters::open()
|
||||
{
|
||||
|
||||
// a transaction is already open at creation time of the draft
|
||||
if (!Gui::Command::hasPendingCommand()) {
|
||||
QString msg = QObject::tr("Edit draft");
|
||||
Gui::Command::openCommand((const char*)msg.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
void TaskDlgDraftParameters::clicked(int)
|
||||
|
|
|
@ -51,12 +51,15 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox">
|
||||
<widget class="Gui::QuantitySpinBox" name="draftAngle">
|
||||
<property name="unit" stdset="0">
|
||||
<string>deg</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>89.000000000000000</double>
|
||||
<double>89.999999999999986</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
|
@ -112,9 +115,14 @@
|
|||
</layout>
|
||||
<zorder>checkReverse</zorder>
|
||||
<zorder>listWidgetFaces</zorder>
|
||||
<zorder>buttonFaceAdd</zorder>
|
||||
<zorder>buttonFaceRemove</zorder>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::QuantitySpinBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Gui/QuantitySpinBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in New Issue
Block a user