PVS: V678 An object is used as an argument to its own method. Consider checking the first actual argument of the 'setupUi' function.

Avoid to include ui generated header files within other header files but use forward declarations instead. This reduces dependencies between files and compile time considerably
This commit is contained in:
wmayer
2020-07-17 13:57:08 +02:00
parent 9e2dc54094
commit 9ee3cd222b
14 changed files with 271 additions and 229 deletions

View File

@@ -26,14 +26,16 @@
#include "PreCompiled.h"
#include "DlgPrefsTechDrawAdvancedImp.h"
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawAdvanced.h>
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDrawAdvancedImp::DlgPrefsTechDrawAdvancedImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawAdvancedImp)
{
this->setupUi(this);
ui->setupUi(this);
}
DlgPrefsTechDrawAdvancedImp::~DlgPrefsTechDrawAdvancedImp()
@@ -43,32 +45,32 @@ DlgPrefsTechDrawAdvancedImp::~DlgPrefsTechDrawAdvancedImp()
void DlgPrefsTechDrawAdvancedImp::saveSettings()
{
cbEndCap->onSave();
cbCrazyEdges->onSave();
cbDebugSection->onSave();
cbDetectFaces->onSave();
cbDebugDetail->onSave();
cbShowSectionEdges->onSave();
cbFuseBeforeSection->onSave();
sbMaxTiles->onSave();
sbMaxPat->onSave();
cbShowLoose->onSave();
leFormatSpec->onSave();
ui->cbEndCap->onSave();
ui->cbCrazyEdges->onSave();
ui->cbDebugSection->onSave();
ui->cbDetectFaces->onSave();
ui->cbDebugDetail->onSave();
ui->cbShowSectionEdges->onSave();
ui->cbFuseBeforeSection->onSave();
ui->sbMaxTiles->onSave();
ui->sbMaxPat->onSave();
ui->cbShowLoose->onSave();
ui->leFormatSpec->onSave();
}
void DlgPrefsTechDrawAdvancedImp::loadSettings()
{
cbEndCap->onRestore();
cbCrazyEdges->onRestore();
cbDebugSection->onRestore();
cbDetectFaces->onRestore();
cbDebugDetail->onRestore();
cbShowSectionEdges->onRestore();
cbFuseBeforeSection->onRestore();
sbMaxTiles->onRestore();
sbMaxPat->onRestore();
cbShowLoose->onRestore();
leFormatSpec->onRestore();
ui->cbEndCap->onRestore();
ui->cbCrazyEdges->onRestore();
ui->cbDebugSection->onRestore();
ui->cbDetectFaces->onRestore();
ui->cbDebugDetail->onRestore();
ui->cbShowSectionEdges->onRestore();
ui->cbFuseBeforeSection->onRestore();
ui->sbMaxTiles->onRestore();
ui->sbMaxPat->onRestore();
ui->cbShowLoose->onRestore();
ui->leFormatSpec->onRestore();
}
/**
@@ -78,7 +80,7 @@ void DlgPrefsTechDrawAdvancedImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPADVANCED_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPADVANCED_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawAdvanced.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawAdvancedImp;
class DlgPrefsTechDrawAdvancedImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawAdvancedImp
class DlgPrefsTechDrawAdvancedImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -42,6 +43,9 @@ protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
std::unique_ptr<Ui_DlgPrefsTechDrawAdvancedImp> ui;
};
} // namespace TechDrawGui

View File

@@ -33,6 +33,7 @@
#include "DrawGuiUtil.h"
#include "PreferencesGui.h"
#include "DlgPrefsTechDrawAnnotationImp.h"
#include "ui_DlgPrefsTechDrawAnnotation.h"
using namespace TechDrawGui;
@@ -41,10 +42,11 @@ using namespace TechDraw;
DlgPrefsTechDrawAnnotationImp::DlgPrefsTechDrawAnnotationImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawAnnotationImp)
{
this->setupUi(this);
pdsbBalloonKink->setUnit(Base::Unit::Length);
pdsbBalloonKink->setMinimum(0);
ui->setupUi(this);
ui->pdsbBalloonKink->setUnit(Base::Unit::Length);
ui->pdsbBalloonKink->setMinimum(0);
}
DlgPrefsTechDrawAnnotationImp::~DlgPrefsTechDrawAnnotationImp()
@@ -54,20 +56,20 @@ DlgPrefsTechDrawAnnotationImp::~DlgPrefsTechDrawAnnotationImp()
void DlgPrefsTechDrawAnnotationImp::saveSettings()
{
cbAutoHoriz->onSave();
cbPrintCenterMarks->onSave();
cbPyramidOrtho->onSave();
cbSectionLineStd->onSave();
cbShowCenterMarks->onSave();
leLineGroup->onSave();
pcbBalloonArrow->onSave();
pcbBalloonShape->onSave();
pcbCenterStyle->onSave();
pcbMatting->onSave();
pcbSectionStyle->onSave();
pdsbBalloonKink->onSave();
cbCutSurface->onSave();
pcbHighlightStyle->onSave();
ui->cbAutoHoriz->onSave();
ui->cbPrintCenterMarks->onSave();
ui->cbPyramidOrtho->onSave();
ui->cbSectionLineStd->onSave();
ui->cbShowCenterMarks->onSave();
ui->leLineGroup->onSave();
ui->pcbBalloonArrow->onSave();
ui->pcbBalloonShape->onSave();
ui->pcbCenterStyle->onSave();
ui->pcbMatting->onSave();
ui->pcbSectionStyle->onSave();
ui->pdsbBalloonKink->onSave();
ui->cbCutSurface->onSave();
ui->pcbHighlightStyle->onSave();
}
void DlgPrefsTechDrawAnnotationImp::loadSettings()
@@ -76,25 +78,25 @@ void DlgPrefsTechDrawAnnotationImp::loadSettings()
//Quantity widgets do not use preset value since they are based on
//QAbstractSpinBox
double kinkDefault = 5.0;
pdsbBalloonKink->setValue(kinkDefault);
ui->pdsbBalloonKink->setValue(kinkDefault);
cbAutoHoriz->onRestore();
cbPrintCenterMarks->onRestore();
cbPyramidOrtho->onRestore();
cbSectionLineStd->onRestore();
cbShowCenterMarks->onRestore();
leLineGroup->onRestore();
pcbBalloonArrow->onRestore();
pcbBalloonShape->onRestore();
pcbCenterStyle->onRestore();
pcbMatting->onRestore();
pcbSectionStyle->onRestore();
pdsbBalloonKink->onRestore();
cbCutSurface->onRestore();
pcbHighlightStyle->onRestore();
ui->cbAutoHoriz->onRestore();
ui->cbPrintCenterMarks->onRestore();
ui->cbPyramidOrtho->onRestore();
ui->cbSectionLineStd->onRestore();
ui->cbShowCenterMarks->onRestore();
ui->leLineGroup->onRestore();
ui->pcbBalloonArrow->onRestore();
ui->pcbBalloonShape->onRestore();
ui->pcbCenterStyle->onRestore();
ui->pcbMatting->onRestore();
ui->pcbSectionStyle->onRestore();
ui->pdsbBalloonKink->onRestore();
ui->cbCutSurface->onRestore();
ui->pcbHighlightStyle->onRestore();
DrawGuiUtil::loadArrowBox(pcbBalloonArrow);
pcbBalloonArrow->setCurrentIndex(prefBalloonArrow());
DrawGuiUtil::loadArrowBox(ui->pcbBalloonArrow);
ui->pcbBalloonArrow->setCurrentIndex(prefBalloonArrow());
}
/**
@@ -104,7 +106,7 @@ void DlgPrefsTechDrawAnnotationImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPANNOTATION_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPANNOTATION_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawAnnotation.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawAnnotationImp;
class DlgPrefsTechDrawAnnotationImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawAnnotationImp
class DlgPrefsTechDrawAnnotationImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -42,8 +43,11 @@ protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
int prefBalloonArrow(void) const;
private:
std::unique_ptr<Ui_DlgPrefsTechDrawAnnotationImp> ui;
};
} // namespace TechDrawGui

View File

@@ -26,14 +26,16 @@
#include "PreCompiled.h"
#include "DlgPrefsTechDrawColorsImp.h"
#include "ui_DlgPrefsTechDrawColors.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDrawColorsImp::DlgPrefsTechDrawColorsImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawColorsImp)
{
this->setupUi(this);
ui->setupUi(this);
}
DlgPrefsTechDrawColorsImp::~DlgPrefsTechDrawColorsImp()
@@ -43,42 +45,42 @@ DlgPrefsTechDrawColorsImp::~DlgPrefsTechDrawColorsImp()
void DlgPrefsTechDrawColorsImp::saveSettings()
{
pcbDimColor->onSave();
pcb_Hatch->onSave();
pcb_Background->onSave();
pcb_PreSelect->onSave();
pcb_Hidden->onSave();
pcb_Select->onSave();
pcb_Normal->onSave();
pcb_Surface->onSave();
pcb_GeomHatch->onSave();
pcb_Face->onSave();
pcb_PaintFaces->onSave();
pcbSectionLine->onSave();
pcbCenterColor->onSave();
pcbVertexColor->onSave();
pcbMarkup->onSave();
pcbHighlight->onSave();
ui->pcbDimColor->onSave();
ui->pcb_Hatch->onSave();
ui->pcb_Background->onSave();
ui->pcb_PreSelect->onSave();
ui->pcb_Hidden->onSave();
ui->pcb_Select->onSave();
ui->pcb_Normal->onSave();
ui->pcb_Surface->onSave();
ui->pcb_GeomHatch->onSave();
ui->pcb_Face->onSave();
ui->pcb_PaintFaces->onSave();
ui->pcbSectionLine->onSave();
ui->pcbCenterColor->onSave();
ui->pcbVertexColor->onSave();
ui->pcbMarkup->onSave();
ui->pcbHighlight->onSave();
}
void DlgPrefsTechDrawColorsImp::loadSettings()
{
pcbDimColor->onRestore();
pcb_Hatch->onRestore();
pcb_Background->onRestore();
pcb_PreSelect->onRestore();
pcb_Hidden->onRestore();
pcb_Select->onRestore();
pcb_Normal->onRestore();
pcb_Surface->onRestore();
pcb_GeomHatch->onRestore();
pcb_Face->onRestore();
pcb_PaintFaces->onRestore();
pcbSectionLine->onRestore();
pcbCenterColor->onRestore();
pcbVertexColor->onRestore();
pcbMarkup->onRestore();
pcbHighlight->onRestore();
ui->pcbDimColor->onRestore();
ui->pcb_Hatch->onRestore();
ui->pcb_Background->onRestore();
ui->pcb_PreSelect->onRestore();
ui->pcb_Hidden->onRestore();
ui->pcb_Select->onRestore();
ui->pcb_Normal->onRestore();
ui->pcb_Surface->onRestore();
ui->pcb_GeomHatch->onRestore();
ui->pcb_Face->onRestore();
ui->pcb_PaintFaces->onRestore();
ui->pcbSectionLine->onRestore();
ui->pcbCenterColor->onRestore();
ui->pcbVertexColor->onRestore();
ui->pcbMarkup->onRestore();
ui->pcbHighlight->onRestore();
}
/**
@@ -88,7 +90,7 @@ void DlgPrefsTechDrawColorsImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPCOLORS_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPCOLORS_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawColors.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawColorsImp;
class DlgPrefsTechDrawColorsImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawColorsImp
class DlgPrefsTechDrawColorsImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -42,6 +43,9 @@ protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
std::unique_ptr<Ui_DlgPrefsTechDrawColorsImp> ui;
};
} // namespace TechDrawGui

View File

@@ -33,6 +33,7 @@
#include "DrawGuiUtil.h"
#include "PreferencesGui.h"
#include "DlgPrefsTechDrawDimensionsImp.h"
#include "ui_DlgPrefsTechDrawDimensions.h"
using namespace TechDrawGui;
@@ -41,12 +42,13 @@ using namespace TechDraw;
DlgPrefsTechDrawDimensionsImp::DlgPrefsTechDrawDimensionsImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawDimensionsImp)
{
this->setupUi(this);
plsb_FontSize->setUnit(Base::Unit::Length);
plsb_FontSize->setMinimum(0);
plsb_ArrowSize->setUnit(Base::Unit::Length);
plsb_ArrowSize->setMinimum(0);
ui->setupUi(this);
ui->plsb_FontSize->setUnit(Base::Unit::Length);
ui->plsb_FontSize->setMinimum(0);
ui->plsb_ArrowSize->setUnit(Base::Unit::Length);
ui->plsb_ArrowSize->setMinimum(0);
}
DlgPrefsTechDrawDimensionsImp::~DlgPrefsTechDrawDimensionsImp()
@@ -56,16 +58,16 @@ DlgPrefsTechDrawDimensionsImp::~DlgPrefsTechDrawDimensionsImp()
void DlgPrefsTechDrawDimensionsImp::saveSettings()
{
cbGlobalDecimals->onSave();
cbHiddenLineStyle->onSave();
cbProjAngle->onSave();
cbShowUnits->onSave();
leDiameter->onSave();
pcbArrow->onSave();
pcbStandardAndStyle->onSave();
plsb_ArrowSize->onSave();
plsb_FontSize->onSave();
sbAltDecimals->onSave();
ui->cbGlobalDecimals->onSave();
ui->cbHiddenLineStyle->onSave();
ui->cbProjAngle->onSave();
ui->cbShowUnits->onSave();
ui->leDiameter->onSave();
ui->pcbArrow->onSave();
ui->pcbStandardAndStyle->onSave();
ui->plsb_ArrowSize->onSave();
ui->plsb_FontSize->onSave();
ui->sbAltDecimals->onSave();
}
void DlgPrefsTechDrawDimensionsImp::loadSettings()
@@ -74,24 +76,24 @@ void DlgPrefsTechDrawDimensionsImp::loadSettings()
//Quantity widgets do not use preset value since they are based on
//QAbstractSpinBox
double fontDefault = Preferences::dimFontSizeMM();
plsb_FontSize->setValue(fontDefault);
ui->plsb_FontSize->setValue(fontDefault);
// double arrowDefault = 5.0;
// plsb_ArrowSize->setValue(arrowDefault);
plsb_ArrowSize->setValue(fontDefault);
ui->plsb_ArrowSize->setValue(fontDefault);
cbGlobalDecimals->onRestore();
cbHiddenLineStyle->onRestore();
cbProjAngle->onRestore();
cbShowUnits->onRestore();
leDiameter->onRestore();
pcbArrow->onRestore();
pcbStandardAndStyle->onRestore();
plsb_ArrowSize->onRestore();
plsb_FontSize->onRestore();
sbAltDecimals->onRestore();
ui->cbGlobalDecimals->onRestore();
ui->cbHiddenLineStyle->onRestore();
ui->cbProjAngle->onRestore();
ui->cbShowUnits->onRestore();
ui->leDiameter->onRestore();
ui->pcbArrow->onRestore();
ui->pcbStandardAndStyle->onRestore();
ui->plsb_ArrowSize->onRestore();
ui->plsb_FontSize->onRestore();
ui->sbAltDecimals->onRestore();
DrawGuiUtil::loadArrowBox(pcbArrow);
pcbArrow->setCurrentIndex(prefArrowStyle());
DrawGuiUtil::loadArrowBox(ui->pcbArrow);
ui->pcbArrow->setCurrentIndex(prefArrowStyle());
}
/**
@@ -101,7 +103,7 @@ void DlgPrefsTechDrawDimensionsImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPDIMENSIONS_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPDIMENSIONS_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawDimensions.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawDimensionsImp;
class DlgPrefsTechDrawDimensionsImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawDimensionsImp
class DlgPrefsTechDrawDimensionsImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -45,6 +46,8 @@ protected:
int prefArrowStyle(void) const;
private:
std::unique_ptr<Ui_DlgPrefsTechDrawDimensionsImp> ui;
};
} // namespace TechDrawGui

View File

@@ -29,18 +29,21 @@
#include <Mod/TechDraw/App/DrawGeomHatch.h>
#include "DlgPrefsTechDrawGeneralImp.h"
#include "ui_DlgPrefsTechDrawGeneral.h"
#include <Gui/PrefWidgets.h>
#include "PreferencesGui.h"
using namespace TechDrawGui;
using namespace TechDraw;
DlgPrefsTechDrawGeneralImp::DlgPrefsTechDrawGeneralImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawGeneralImp)
{
this->setupUi(this);
plsb_LabelSize->setUnit(Base::Unit::Length);
plsb_LabelSize->setMinimum(0);
ui->setupUi(this);
ui->plsb_LabelSize->setUnit(Base::Unit::Length);
ui->plsb_LabelSize->setMinimum(0);
}
DlgPrefsTechDrawGeneralImp::~DlgPrefsTechDrawGeneralImp()
@@ -50,54 +53,54 @@ DlgPrefsTechDrawGeneralImp::~DlgPrefsTechDrawGeneralImp()
void DlgPrefsTechDrawGeneralImp::saveSettings()
{
pfc_DefTemp->onSave();
pfc_DefDir->onSave();
pfc_HatchFile->onSave();
pfc_FilePattern->onSave();
pfc_LineGroup->onSave();
pfc_Welding->onSave();
le_NamePattern->onSave();
ui->pfc_DefTemp->onSave();
ui->pfc_DefDir->onSave();
ui->pfc_HatchFile->onSave();
ui->pfc_FilePattern->onSave();
ui->pfc_LineGroup->onSave();
ui->pfc_Welding->onSave();
ui->le_NamePattern->onSave();
pfb_LabelFont->onSave();
plsb_LabelSize->onSave();
ui->pfb_LabelFont->onSave();
ui->plsb_LabelSize->onSave();
cb_Global->onSave();
cb_Override->onSave();
cb_PageUpdate->onSave();
cb_AutoDist->onSave();
ui->cb_Global->onSave();
ui->cb_Override->onSave();
ui->cb_PageUpdate->onSave();
ui->cb_AutoDist->onSave();
}
void DlgPrefsTechDrawGeneralImp::loadSettings()
{
// double labelDefault = 8.0;
double labelDefault = Preferences::labelFontSizeMM();
plsb_LabelSize->setValue(labelDefault);
ui->plsb_LabelSize->setValue(labelDefault);
QFont prefFont(Preferences::labelFontQString());
pfb_LabelFont->setCurrentFont(prefFont);
// pfb_LabelFont->setCurrentText(Preferences::labelFontQString()); //only works in Qt5
ui->pfb_LabelFont->setCurrentFont(prefFont);
// ui->pfb_LabelFont->setCurrentText(Preferences::labelFontQString()); //only works in Qt5
pfc_DefTemp->setFileName(Preferences::defaultTemplate());
pfc_DefDir->setFileName(Preferences::defaultTemplateDir());
pfc_HatchFile->setFileName(QString::fromStdString(DrawHatch::prefSvgHatch()));
pfc_FilePattern->setFileName(QString::fromStdString(DrawGeomHatch::prefGeomHatchFile()));
pfc_Welding->setFileName(PreferencesGui::weldingDirectory());
pfc_LineGroup->setFileName(QString::fromUtf8(Preferences::lineGroupFile().c_str()));
ui->pfc_DefTemp->setFileName(Preferences::defaultTemplate());
ui->pfc_DefDir->setFileName(Preferences::defaultTemplateDir());
ui->pfc_HatchFile->setFileName(QString::fromStdString(DrawHatch::prefSvgHatch()));
ui->pfc_FilePattern->setFileName(QString::fromStdString(DrawGeomHatch::prefGeomHatchFile()));
ui->pfc_Welding->setFileName(PreferencesGui::weldingDirectory());
ui->pfc_LineGroup->setFileName(QString::fromUtf8(Preferences::lineGroupFile().c_str()));
pfc_DefTemp->onRestore();
pfc_DefDir->onRestore();
pfc_HatchFile->onRestore();
pfc_FilePattern->onRestore();
pfc_LineGroup->onRestore();
pfc_Welding->onRestore();
le_NamePattern->onRestore();
ui->pfc_DefTemp->onRestore();
ui->pfc_DefDir->onRestore();
ui->pfc_HatchFile->onRestore();
ui->pfc_FilePattern->onRestore();
ui->pfc_LineGroup->onRestore();
ui->pfc_Welding->onRestore();
ui->le_NamePattern->onRestore();
pfb_LabelFont->onRestore();
plsb_LabelSize->onRestore();
ui->pfb_LabelFont->onRestore();
ui->plsb_LabelSize->onRestore();
cb_Global->onRestore();
cb_Override->onRestore();
cb_PageUpdate->onRestore();
cb_AutoDist->onRestore();
ui->cb_Global->onRestore();
ui->cb_Override->onRestore();
ui->cb_PageUpdate->onRestore();
ui->cb_AutoDist->onRestore();
}
/**
@@ -107,7 +110,7 @@ void DlgPrefsTechDrawGeneralImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPGENERAL_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPGENERAL_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawGeneral.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawGeneralImp;
class DlgPrefsTechDrawGeneralImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawGeneralImp
class DlgPrefsTechDrawGeneralImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -42,6 +43,9 @@ protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
std::unique_ptr<Ui_DlgPrefsTechDrawGeneralImp> ui;
};
} // namespace TechDrawGui

View File

@@ -26,14 +26,16 @@
#include "PreCompiled.h"
#include "DlgPrefsTechDrawHLRImp.h"
#include "ui_DlgPrefsTechDrawHLR.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDrawHLRImp::DlgPrefsTechDrawHLRImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawHLRImp)
{
this->setupUi(this);
ui->setupUi(this);
}
DlgPrefsTechDrawHLRImp::~DlgPrefsTechDrawHLRImp()
@@ -43,30 +45,30 @@ DlgPrefsTechDrawHLRImp::~DlgPrefsTechDrawHLRImp()
void DlgPrefsTechDrawHLRImp::saveSettings()
{
pcbSeamViz->onSave();
pcbSmoothViz->onSave();
pcbHardViz->onSave();
pcbPolygon->onSave();
pcbIsoViz->onSave();
pcbSmoothHid->onSave();
pcbSeamHid->onSave();
pcbIsoHid->onSave();
psbIsoCount->onSave();
pcbHardHid->onSave();
ui->pcbSeamViz->onSave();
ui->pcbSmoothViz->onSave();
ui->pcbHardViz->onSave();
ui->pcbPolygon->onSave();
ui->pcbIsoViz->onSave();
ui->pcbSmoothHid->onSave();
ui->pcbSeamHid->onSave();
ui->pcbIsoHid->onSave();
ui->psbIsoCount->onSave();
ui->pcbHardHid->onSave();
}
void DlgPrefsTechDrawHLRImp::loadSettings()
{
pcbSeamViz->onRestore();
pcbSmoothViz->onRestore();
pcbHardViz->onRestore();
pcbPolygon->onRestore();
pcbIsoViz->onRestore();
pcbSmoothHid->onRestore();
pcbSeamHid->onRestore();
pcbIsoHid->onRestore();
psbIsoCount->onRestore();
pcbHardHid->onRestore();
ui->pcbSeamViz->onRestore();
ui->pcbSmoothViz->onRestore();
ui->pcbHardViz->onRestore();
ui->pcbPolygon->onRestore();
ui->pcbIsoViz->onRestore();
ui->pcbSmoothHid->onRestore();
ui->pcbSeamHid->onRestore();
ui->pcbIsoHid->onRestore();
ui->psbIsoCount->onRestore();
ui->pcbHardHid->onRestore();
}
/**
@@ -76,7 +78,7 @@ void DlgPrefsTechDrawHLRImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPHLR_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPHLR_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawHLR.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawHLRImp;
class DlgPrefsTechDrawHLRImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawHLRImp
class DlgPrefsTechDrawHLRImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -42,6 +43,9 @@ protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
std::unique_ptr<Ui_DlgPrefsTechDrawHLRImp> ui;
};
} // namespace TechDrawGui

View File

@@ -26,19 +26,21 @@
#include "PreCompiled.h"
#include "DlgPrefsTechDrawScaleImp.h"
#include "ui_DlgPrefsTechDrawScale.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDrawScaleImp::DlgPrefsTechDrawScaleImp( QWidget* parent )
: PreferencePage( parent )
, ui(new Ui_DlgPrefsTechDrawScaleImp)
{
this->setupUi(this);
ui->setupUi(this);
this->pdsbTemplateMark->setUnit(Base::Unit::Length);
this->pdsbTemplateMark->setMinimum(0);
ui->pdsbTemplateMark->setUnit(Base::Unit::Length);
ui->pdsbTemplateMark->setMinimum(0);
connect(this->cbViewScaleType, SIGNAL(currentIndexChanged(int)),
connect(ui->cbViewScaleType, SIGNAL(currentIndexChanged(int)),
this, SLOT(onScaleTypeChanged(int)));
}
@@ -52,41 +54,41 @@ void DlgPrefsTechDrawScaleImp::onScaleTypeChanged(int index)
// disable custom scale if the scale type is not custom
if (index == 2) // if custom
this->pdsbViewScale->setEnabled(true);
ui->pdsbViewScale->setEnabled(true);
else
this->pdsbViewScale->setEnabled(false);
ui->pdsbViewScale->setEnabled(false);
}
void DlgPrefsTechDrawScaleImp::saveSettings()
{
pdsbToleranceScale->onSave();
pdsbTemplateMark->onSave();
pdsbVertexScale->onSave();
pdsbCenterScale->onSave();
pdsbPageScale->onSave();
cbViewScaleType->onSave();
pdsbViewScale->onSave();
pdsbEdgeFuzz->onSave();
pdsbMarkFuzz->onSave();
pdsbTemplateMark->onSave();
pdsbSymbolScale->onSave();
ui->pdsbToleranceScale->onSave();
ui->pdsbTemplateMark->onSave();
ui->pdsbVertexScale->onSave();
ui->pdsbCenterScale->onSave();
ui->pdsbPageScale->onSave();
ui->cbViewScaleType->onSave();
ui->pdsbViewScale->onSave();
ui->pdsbEdgeFuzz->onSave();
ui->pdsbMarkFuzz->onSave();
ui->pdsbTemplateMark->onSave();
ui->pdsbSymbolScale->onSave();
}
void DlgPrefsTechDrawScaleImp::loadSettings()
{
double markDefault = 3.0;
pdsbTemplateMark->setValue(markDefault);
pdsbToleranceScale->onRestore();
pdsbTemplateMark->onRestore();
pdsbVertexScale->onRestore();
pdsbCenterScale->onRestore();
pdsbPageScale->onRestore();
cbViewScaleType->onRestore();
pdsbViewScale->onRestore();
pdsbEdgeFuzz->onRestore();
pdsbMarkFuzz->onRestore();
pdsbTemplateMark->onRestore();
pdsbSymbolScale->onRestore();
ui->pdsbTemplateMark->setValue(markDefault);
ui->pdsbToleranceScale->onRestore();
ui->pdsbTemplateMark->onRestore();
ui->pdsbVertexScale->onRestore();
ui->pdsbCenterScale->onRestore();
ui->pdsbPageScale->onRestore();
ui->cbViewScaleType->onRestore();
ui->pdsbViewScale->onRestore();
ui->pdsbEdgeFuzz->onRestore();
ui->pdsbMarkFuzz->onRestore();
ui->pdsbTemplateMark->onRestore();
ui->pdsbSymbolScale->onRestore();
}
/**
@@ -96,7 +98,7 @@ void DlgPrefsTechDrawScaleImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
ui->retranslateUi(this);
loadSettings();
}
else {

View File

@@ -25,12 +25,13 @@
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPSCALE_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPSCALE_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawScale.h>
#include <Gui/PropertyPage.h>
#include <memory>
namespace TechDrawGui {
class Ui_DlgPrefsTechDrawScaleImp;
class DlgPrefsTechDrawScaleImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawScaleImp
class DlgPrefsTechDrawScaleImp : public Gui::Dialog::PreferencePage
{
Q_OBJECT
@@ -45,6 +46,9 @@ protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
private:
std::unique_ptr<Ui_DlgPrefsTechDrawScaleImp> ui;
};
} // namespace TechDrawGui