diff --git a/src/Mod/TechDraw/App/DrawViewDimension.cpp b/src/Mod/TechDraw/App/DrawViewDimension.cpp index f848373005..bb28a7ca53 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.cpp +++ b/src/Mod/TechDraw/App/DrawViewDimension.cpp @@ -111,7 +111,8 @@ DrawViewDimension::DrawViewDimension(void) References3D.setScope(App::LinkScope::Global); ADD_PROPERTY_TYPE(FormatSpec, (getDefaultFormatSpec()), "Format", App::Prop_Output,"Dimension Format"); - ADD_PROPERTY_TYPE(FormatSpecTolerance, (getDefaultFormatSpec(true)), "Format", App::Prop_Output, "Dimension tolerance format"); + ADD_PROPERTY_TYPE(FormatSpecUnderTolerance, (getDefaultFormatSpec(true)), "Format", App::Prop_Output, "Dimension tolerance format"); + ADD_PROPERTY_TYPE(FormatSpecOverTolerance, (getDefaultFormatSpec(true)), "Format", App::Prop_Output, "Dimension tolerance format"); ADD_PROPERTY_TYPE(Arbitrary,(false), "Format", App::Prop_Output, "Value overridden by user"); ADD_PROPERTY_TYPE(ArbitraryTolerances, (false), "Format", App::Prop_Output, "Tolerance values overridden by user"); @@ -846,11 +847,12 @@ std::string DrawViewDimension::formatValue(qreal value, QString qFormatSpec, int } return result; + } std::string DrawViewDimension::getFormattedToleranceValue(int partial) { - QString FormatSpec = QString::fromUtf8(FormatSpecTolerance.getStrValue().data()); + QString FormatSpec = QString::fromUtf8(FormatSpecOverTolerance.getStrValue().data()); QString ToleranceString; if (ArbitraryTolerances.getValue()) @@ -863,25 +865,26 @@ std::string DrawViewDimension::getFormattedToleranceValue(int partial) std::pair DrawViewDimension::getFormattedToleranceValues(int partial) { - QString FormatSpec = QString::fromUtf8(FormatSpecTolerance.getStrValue().data()); + QString underFormatSpec = QString::fromUtf8(FormatSpecUnderTolerance.getStrValue().data()); + QString overFormatSpec = QString::fromUtf8(FormatSpecOverTolerance.getStrValue().data()); std::pair tolerances; QString underTolerance, overTolerance; if (ArbitraryTolerances.getValue()) { - underTolerance = FormatSpec; - overTolerance = FormatSpec; + underTolerance = underFormatSpec; + overTolerance = overFormatSpec; } else { if (DrawUtil::fpCompare(UnderTolerance.getValue(), 0.0)) { underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), QString::fromUtf8("%.0f"), partial).c_str()); } else { - underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), FormatSpec, partial).c_str()); + underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), underFormatSpec, partial).c_str()); } if (DrawUtil::fpCompare(OverTolerance.getValue(), 0.0)) { overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), QString::fromUtf8("%.0f"), partial).c_str()); } else { - overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), FormatSpec, partial).c_str()); + overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), overFormatSpec, partial).c_str()); } } diff --git a/src/Mod/TechDraw/App/DrawViewDimension.h b/src/Mod/TechDraw/App/DrawViewDimension.h index 8876bb5356..040bd22285 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.h +++ b/src/Mod/TechDraw/App/DrawViewDimension.h @@ -102,7 +102,8 @@ public: App::PropertyBool TheoreticalExact; App::PropertyBool Inverted; App::PropertyString FormatSpec; - App::PropertyString FormatSpecTolerance; + App::PropertyString FormatSpecUnderTolerance; + App::PropertyString FormatSpecOverTolerance; App::PropertyBool Arbitrary; App::PropertyBool ArbitraryTolerances; App::PropertyBool EqualTolerance; diff --git a/src/Mod/TechDraw/Gui/TaskDimension.cpp b/src/Mod/TechDraw/Gui/TaskDimension.cpp index ad8967bb31..f51c03cc13 100644 --- a/src/Mod/TechDraw/Gui/TaskDimension.cpp +++ b/src/Mod/TechDraw/Gui/TaskDimension.cpp @@ -98,7 +98,7 @@ TaskDimension::TaskDimension(QGIViewDimension *parent, ViewProviderDimension *di connect(ui->leFormatSpecifier, SIGNAL(textChanged(QString)), this, SLOT(onFormatSpecifierChanged())); ui->cbArbitrary->setChecked(parent->dvDimension->Arbitrary.getValue()); connect(ui->cbArbitrary, SIGNAL(stateChanged(int)), this, SLOT(onArbitraryChanged())); - StringValue = parent->dvDimension->FormatSpecTolerance.getValue(); + StringValue = parent->dvDimension->FormatSpecOverTolerance.getValue(); qs = QString::fromUtf8(StringValue.data(), StringValue.size()); ui->leToleranceFormatSpecifier->setText(qs); connect(ui->leToleranceFormatSpecifier, SIGNAL(textChanged(QString)), this, SLOT(onToleranceFormatSpecifierChanged())); @@ -133,7 +133,7 @@ bool TaskDimension::accept() m_parent->dvDimension->FormatSpec.setValue(ui->leFormatSpecifier->text().toUtf8().constData()); m_parent->dvDimension->Arbitrary.setValue(ui->cbArbitrary->isChecked()); - m_parent->dvDimension->FormatSpecTolerance.setValue(ui->leToleranceFormatSpecifier->text().toUtf8().constData()); + m_parent->dvDimension->FormatSpecOverTolerance.setValue(ui->leToleranceFormatSpecifier->text().toUtf8().constData()); m_parent->dvDimension->ArbitraryTolerances.setValue(ui->cbArbitraryTolerances->isChecked()); m_dimensionVP->FlipArrowheads.setValue(ui->cbArrowheads->isChecked()); @@ -234,7 +234,7 @@ void TaskDimension::onArbitraryChanged() void TaskDimension::onToleranceFormatSpecifierChanged() { - m_parent->dvDimension->FormatSpecTolerance.setValue(ui->leToleranceFormatSpecifier->text().toUtf8().constData()); + m_parent->dvDimension->FormatSpecOverTolerance.setValue(ui->leToleranceFormatSpecifier->text().toUtf8().constData()); recomputeFeature(); }