[TD] TaskCenterLine add missing unit initialization

next try because PR #3275 cannot be merged.
This commit is contained in:
donovaly
2020-03-28 21:23:08 +01:00
committed by WandererFan
parent d9e65c7780
commit 9064768a5c
2 changed files with 9 additions and 4 deletions

View File

@@ -173,6 +173,8 @@ void TaskCenterLine::setUiPrimary()
ui->dsbWeight->setValue(getCenterWidth());
ui->cboxStyle->setCurrentIndex(getCenterStyle() - 1);
ui->qsbVertShift->setUnit(Base::Unit::Length);
ui->qsbHorizShift->setUnit(Base::Unit::Length);
Base::Quantity qVal;
qVal.setUnit(Base::Unit::Length);
qVal.setValue(getExtendBy());
@@ -305,7 +307,7 @@ void TaskCenterLine::onColorChanged()
void TaskCenterLine::onWeightChanged()
{
m_cl->m_format.m_weight = ui->dsbWeight->value();
m_cl->m_format.m_weight = ui->dsbWeight->value().getValue();
m_partFeat->recomputeFeature();
}
@@ -355,7 +357,7 @@ void TaskCenterLine::createCenterLine(void)
App::Color ac;
ac.setValue<QColor>(ui->cpLineColor->color());
cl->m_format.m_color = ac;
cl->m_format.m_weight = ui->dsbWeight->value();
cl->m_format.m_weight = ui->dsbWeight->value().getValue();
cl->m_format.m_style = ui->cboxStyle->currentIndex() + 1; //Qt Styles start at 0:NoLine
cl->m_format.m_visible = true;
m_partFeat->addCenterLine(cl);
@@ -373,7 +375,7 @@ void TaskCenterLine::updateCenterLine(void)
// Base::Console().Message("TCL::updateCenterLine()\n");
Gui::Command::openCommand("Edit CenterLine");
m_cl->m_format.m_color.setValue<QColor>(ui->cpLineColor->color() );
m_cl->m_format.m_weight = ui->dsbWeight->value();
m_cl->m_format.m_weight = ui->dsbWeight->value().getValue();
m_cl->m_format.m_style = ui->cboxStyle->currentIndex() + 1;
m_cl->m_format.m_visible = true;

View File

@@ -221,6 +221,9 @@
<property name="toolTip">
<string>Rotate line +CCW or -CW</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="minimum">
<double>-360.000000000000000</double>
</property>
@@ -295,7 +298,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="dsbWeight">
<widget class="Gui::QuantitySpinBox" name="dsbWeight">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>