[TD]move format spec to dimension tab

- also make %.2w default format
This commit is contained in:
Wanderer Fan
2022-03-02 18:03:41 -05:00
committed by WandererFan
parent 0149b99b6f
commit 58d1ef260b
7 changed files with 550 additions and 544 deletions

View File

@@ -1470,9 +1470,7 @@ std::string DrawViewDimension::getPrefix() const
std::string DrawViewDimension::getDefaultFormatSpec(bool isToleranceFormat) const
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
std::string prefFormat = hGrp->GetASCII("formatSpec","");
std::string prefFormat = Preferences::formatSpec();
QString formatSpec;
QString qPrefix;
if (prefFormat.empty()) {
@@ -1482,7 +1480,7 @@ std::string DrawViewDimension::getDefaultFormatSpec(bool isToleranceFormat) cons
if (useDecimals()) {
precision = Base::UnitsApi::getDecimals();
} else {
precision = hGrp->GetInt("AltDecimals", 2);
precision = Preferences::altDecimals();
}
QString formatPrecision = QString::number(precision);

View File

@@ -233,3 +233,17 @@ std::string Preferences::lineGroupFile()
}
return lgFileName;
}
std::string Preferences::formatSpec()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
return hGrp->GetASCII("formatSpec","%.2w");
}
int Preferences::altDecimals()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
return hGrp->GetInt("AltDecimals", 2);
}

View File

@@ -67,9 +67,11 @@ static QString defaultTemplate();
static QString defaultTemplateDir();
static std::string lineGroupFile();
static const double DefaultFontSizeInMM;
static std::string formatSpec();
static int altDecimals();
};
} //end namespace TechDraw

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>440</width>
<height>351</height>
<height>353</height>
</rect>
</property>
<property name="windowTitle">
@@ -39,96 +39,8 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,1">
<item row="3" column="0">
<widget class="Gui::PrefCheckBox" name="cbShowLoose">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Include 2D Objects in projection</string>
</property>
<property name="text">
<string>Show Loose 2D Geom</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowLoose2d</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="cbCrazyEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include edges with unexpected geometry (zero length etc.) in results</string>
</property>
<property name="text">
<string>Allow Crazy Edges</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>allowCrazyEdge</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Edge Fuzz</string>
</property>
</widget>
</item>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0">
<item row="6" column="2">
<widget class="Gui::PrefLineEdit" name="leFormatSpec">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Override automatic dimension format</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="prefEntry" stdset="0">
<cstring>formatSpec</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefComboBox" name="cbEndCap">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -174,60 +86,31 @@ Only change unless you know what you are doing!</string>
</item>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::PrefCheckBox" name="cbFuseBeforeSection">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="cbDetectFaces">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Perform a fuse operation on input shape(s) before Section view processing</string>
<string>If checked, TechDraw will attempt to build faces using the
line segments returned by the hidden line removal algorithm.
Faces must be detected in order to use hatching, but there
can be a performance penalty in complex models.</string>
</property>
<property name="text">
<string>Fuse Before Section</string>
<string>Detect Faces</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionFuseFirst</cstring>
<cstring>HandleFaces</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Dimension Format</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Line End Cap Shape</string>
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
@@ -244,116 +127,7 @@ Only change unless you know what you are doing!</string>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbDebugDetail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Dump intermediate results during Detail view processing</string>
</property>
<property name="text">
<string>Debug Detail</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugDetail</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowSectionEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Highlights border of section cut in section views</string>
</property>
<property name="text">
<string>Show Section Edges</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowSectionEdges</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxTiles">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Limit of 64x64 pixel SVG tiles used to hatch a single face.
For large scalings you might get an error about to many SVG tiles.
Then you need to increase the tile limit.</string>
</property>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>10000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>MaxSVGTile</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Max SVG Hatch Tiles</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max PAT Hatch Segments</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxPat">
<property name="minimumSize">
<size>
@@ -388,56 +162,75 @@ when hatching a face with a PAT pattern</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbDebugSection">
<item row="0" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowSectionEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Dump intermediate results during Section view processing</string>
</property>
<property name="text">
<string>Debug Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugSection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="cbDetectFaces">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>If checked, TechDraw will attempt to build faces using the
line segments returned by the hidden line removal algorithm.
Faces must be detected in order to use hatching, but there
can be a performance penalty in complex models.</string>
<string>Highlights border of section cut in section views</string>
</property>
<property name="text">
<string>Detect Faces</string>
<string>Show Section Edges</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>HandleFaces</cstring>
<cstring>ShowSectionEdges</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Edge Fuzz</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Line End Cap Shape</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Max SVG Hatch Tiles</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_4">
<property name="minimumSize">
@@ -451,6 +244,61 @@ can be a performance penalty in complex models.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="Gui::PrefCheckBox" name="cbCrazyEdges">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Include edges with unexpected geometry (zero length etc.) in results</string>
</property>
<property name="text">
<string>Allow Crazy Edges</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>allowCrazyEdge</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::PrefCheckBox" name="cbFuseBeforeSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Perform a fuse operation on input shape(s) before Section view processing</string>
</property>
<property name="text">
<string>Fuse Before Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionFuseFirst</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbEdgeFuzz">
<property name="sizePolicy">
@@ -492,6 +340,99 @@ Each unit is approx. 0.1 mm wide</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbDebugDetail">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Dump intermediate results during Detail view processing</string>
</property>
<property name="text">
<string>Debug Detail</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugDetail</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max PAT Hatch Segments</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefSpinBox" name="sbMaxTiles">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Limit of 64x64 pixel SVG tiles used to hatch a single face.
For large scalings you might get an error about to many SVG tiles.
Then you need to increase the tile limit.</string>
</property>
<property name="alignment">
<set>Qt::AlignRight</set>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>10000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>MaxSVGTile</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbDebugSection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Dump intermediate results during Section view processing</string>
</property>
<property name="text">
<string>Debug Section</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>debugSection</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/debug</cstring>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbMarkFuzz">
<property name="sizePolicy">
@@ -533,6 +474,31 @@ Each unit is approx. 0.1 mm wide</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="Gui::PrefCheckBox" name="cbShowLoose">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="toolTip">
<string>Include 2D Objects in projection</string>
</property>
<property name="text">
<string>Show Loose 2D Geom</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowLoose2d</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/General</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -588,11 +554,6 @@ Each unit is approx. 0.1 mm wide</string>
<extends>QComboBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefLineEdit</class>
<extends>QLineEdit</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>

View File

@@ -54,7 +54,6 @@ void DlgPrefsTechDrawAdvancedImp::saveSettings()
ui->cbShowLoose->onSave();
ui->pdsbEdgeFuzz->onSave();
ui->pdsbMarkFuzz->onSave();
ui->leFormatSpec->onSave();
ui->cbEndCap->onSave();
ui->sbMaxTiles->onSave();
ui->sbMaxPat->onSave();
@@ -71,7 +70,6 @@ void DlgPrefsTechDrawAdvancedImp::loadSettings()
ui->cbShowLoose->onRestore();
ui->pdsbEdgeFuzz->onRestore();
ui->pdsbMarkFuzz->onRestore();
ui->leFormatSpec->onRestore();
ui->cbEndCap->onRestore();
ui->sbMaxTiles->onRestore();
ui->sbMaxPat->onRestore();

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>440</width>
<height>336</height>
<height>380</height>
</rect>
</property>
<property name="sizePolicy">
@@ -46,6 +46,225 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="8" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Size</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Diameter Symbol</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_FontSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Dimension text font size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>4.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>FontSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbToleranceScale">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>174</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Tolerance text scale
Multiplier of 'Font Size'</string>
</property>
<property name="accessibleName">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.800000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>TolSizeAdjust</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowUnits">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Append unit to dimension values</string>
</property>
<property name="text">
<string>Show Units</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowUnits</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Font Size</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Style</string>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lbl_LabelFont">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Tolerance Text Scale</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="Gui::PrefLineEdit" name="leDiameter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="toolTip">
<string>Character used to indicate diameter dimensions</string>
</property>
<property name="text">
<string>⌀</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="prefEntry" stdset="0">
<cstring>DiameterSymbol</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="Gui::PrefComboBox" name="pcbStandardAndStyle">
<property name="sizePolicy">
@@ -91,15 +310,10 @@
</item>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Arrow Style</string>
<string>Alternate Decimals</string>
</property>
</widget>
</item>
@@ -121,117 +335,6 @@
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="Gui::PrefComboBox" name="pcbArrow">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead style</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Arrow Size</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="Gui::PrefLineEdit" name="leDiameter">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="toolTip">
<string>Character used to indicate diameter dimensions</string>
</property>
<property name="text">
<string>⌀</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="prefEntry" stdset="0">
<cstring>DiameterSymbol</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="Gui::PrefCheckBox" name="cbShowUnits">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Append unit to dimension values</string>
</property>
<property name="text">
<string>Show Units</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowUnits</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Diameter Symbol</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="cbGlobalDecimals">
<property name="sizePolicy">
@@ -262,6 +365,65 @@
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_ArrowSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefComboBox" name="pcbArrow">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead style</string>
</property>
<property name="currentIndex">
<number>-1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowStyle</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="Gui::PrefSpinBox" name="sbAltDecimals">
<property name="enabled">
@@ -296,165 +458,31 @@
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_FontSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Dimension text font size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>4.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>FontSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="Gui::PrefUnitSpinBox" name="plsb_ArrowSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="toolTip">
<string>Arrowhead size</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="value">
<double>5.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>ArrowSize</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Alternate Decimals</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="label">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Font Size</string>
<string>Dimension Format</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lbl_LabelFont">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Tolerance Text Scale</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="pdsbToleranceScale">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>174</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<item row="3" column="2">
<widget class="Gui::PrefLineEdit" name="leFormatSpec">
<property name="toolTip">
<string>Tolerance text scale
Multiplier of 'Font Size'</string>
</property>
<property name="accessibleName">
<string/>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Leave blank for automatic dimension format. Use %f, %g or %w specifiers to override.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.800000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>TolSizeAdjust</cstring>
<cstring>formatSpec</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
<cstring>/Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
@@ -472,7 +500,7 @@ Multiplier of 'Font Size'</string>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=" font-weight:600;"&gt;Note:&lt;/span&gt; Items in &lt;span style=" font-style:italic;"&gt;italics&lt;/span&gt; are default values for new objects. They have no effect on existing objects.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note:&lt;/span&gt; Items in &lt;span style=&quot; font-style:italic;&quot;&gt;italics&lt;/span&gt; are default values for new objects. They have no effect on existing objects.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@@ -29,6 +29,7 @@
#include <Base/Parameter.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#include "DrawGuiUtil.h"
#include "PreferencesGui.h"
@@ -67,6 +68,7 @@ void DlgPrefsTechDrawDimensionsImp::saveSettings()
ui->leDiameter->onSave();
ui->pcbArrow->onSave();
ui->plsb_ArrowSize->onSave();
ui->leFormatSpec->onSave();
}
void DlgPrefsTechDrawDimensionsImp::loadSettings()
@@ -92,6 +94,9 @@ void DlgPrefsTechDrawDimensionsImp::loadSettings()
DrawGuiUtil::loadArrowBox(ui->pcbArrow);
ui->pcbArrow->setCurrentIndex(prefArrowStyle());
ui->leFormatSpec->setText(Base::Tools::fromStdString(Preferences::formatSpec()));
ui->leFormatSpec->onRestore();
}
/**