+ use quantity boxes in inspection dialog
This commit is contained in:
parent
3fc7b6bfb2
commit
f868120a77
|
@ -89,9 +89,9 @@ VisualInspection::VisualInspection(QWidget* parent, Qt::WindowFlags fl)
|
|||
|
||||
//FIXME: Not used yet
|
||||
ui->textLabel2->hide();
|
||||
ui->prefFloatSpinBox2->hide();
|
||||
ui->prefFloatSpinBox1->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->prefFloatSpinBox2->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->thickness->hide();
|
||||
ui->searchRadius->setUnit(Base::Unit::Length);
|
||||
ui->thickness->setUnit(Base::Unit::Length);
|
||||
|
||||
App::Document* doc = App::GetApplication().getActiveDocument();
|
||||
// disable Ok button and enable of at least one item in each view is on
|
||||
|
@ -147,14 +147,27 @@ VisualInspection::~VisualInspection()
|
|||
|
||||
void VisualInspection::loadSettings()
|
||||
{
|
||||
ui->prefFloatSpinBox1->onRestore();
|
||||
ui->prefFloatSpinBox2->onRestore();
|
||||
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Inspection/Inspection");
|
||||
|
||||
double searchDistance = ui->searchRadius->value().getValue();
|
||||
searchDistance = handle->GetFloat("SearchDistance", searchDistance);
|
||||
ui->searchRadius->setValue(searchDistance);
|
||||
|
||||
double thickness = ui->thickness->value().getValue();
|
||||
thickness = handle->GetFloat("Thickness", thickness);
|
||||
ui->thickness->setValue(thickness);
|
||||
}
|
||||
|
||||
void VisualInspection::saveSettings()
|
||||
{
|
||||
ui->prefFloatSpinBox1->onSave();
|
||||
ui->prefFloatSpinBox2->onSave();
|
||||
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Inspection/Inspection");
|
||||
double searchDistance = ui->searchRadius->value().getValue();
|
||||
handle->SetFloat("SearchDistance", searchDistance);
|
||||
|
||||
double thickness = ui->thickness->value().getValue();
|
||||
handle->SetFloat("Thickness", thickness);
|
||||
}
|
||||
|
||||
void VisualInspection::onActivateItem(QTreeWidgetItem* item)
|
||||
|
@ -204,8 +217,8 @@ void VisualInspection::accept()
|
|||
nominalNames << sel->data(0, Qt::UserRole).toString();
|
||||
}
|
||||
|
||||
float searchRadius = ui->prefFloatSpinBox1->value();
|
||||
float thickness = ui->prefFloatSpinBox2->value();
|
||||
double searchRadius = ui->searchRadius->value().getValue();
|
||||
double thickness = ui->thickness->value().getValue();
|
||||
|
||||
// open a new command
|
||||
Gui::Document* doc = Gui::Application::Instance->activeDocument();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>540</width>
|
||||
<width>568</width>
|
||||
<height>406</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -108,16 +108,19 @@
|
|||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="prefFloatSpinBox2">
|
||||
<property name="suffix">
|
||||
<string> mm</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
<widget class="Gui::QuantitySpinBox" name="thickness">
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="suffix" stdset="0">
|
||||
<string> mm</string>
|
||||
</property>
|
||||
<property name="decimals" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>Thickness</cstring>
|
||||
</property>
|
||||
|
@ -134,16 +137,22 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="prefFloatSpinBox1">
|
||||
<property name="suffix">
|
||||
<string> mm</string>
|
||||
<widget class="Gui::QuantitySpinBox" name="searchRadius">
|
||||
<property name="unit" stdset="0">
|
||||
<string notr="true">mm</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="suffix" stdset="0">
|
||||
<string> mm</string>
|
||||
</property>
|
||||
<property name="decimals" stdset="0">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>SearchDistance</cstring>
|
||||
</property>
|
||||
|
@ -165,7 +174,7 @@
|
|||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -181,7 +190,7 @@
|
|||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
<enum>QSizePolicy::Preferred</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
@ -208,14 +217,14 @@
|
|||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Gui::PrefDoubleSpinBox</class>
|
||||
<extends>QDoubleSpinBox</extends>
|
||||
<header>Gui/PrefWidgets.h</header>
|
||||
<class>Gui::QuantitySpinBox</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Gui/QuantitySpinBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>prefFloatSpinBox1</tabstop>
|
||||
<tabstop>prefFloatSpinBox2</tabstop>
|
||||
<tabstop>searchRadius</tabstop>
|
||||
<tabstop>thickness</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
|
|
@ -43,7 +43,7 @@ DlgSettingsImportExport::~DlgSettingsImportExport()
|
|||
void DlgSettingsImportExport::saveSettings()
|
||||
{
|
||||
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Mesh/");
|
||||
("User parameter:BaseApp/Preferences/Mod/Mesh");
|
||||
double value = ui->maxDeviationExport->value().getValue();
|
||||
handle->SetFloat("MaxDeviationExport", value);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ void DlgSettingsImportExport::saveSettings()
|
|||
void DlgSettingsImportExport::loadSettings()
|
||||
{
|
||||
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Mesh/");
|
||||
("User parameter:BaseApp/Preferences/Mod/Mesh");
|
||||
double value = ui->maxDeviationExport->value().getValue();
|
||||
value = handle->GetFloat("MaxDeviationExport", value);
|
||||
ui->maxDeviationExport->setValue(value);
|
||||
|
|
Loading…
Reference in New Issue
Block a user