[Sketcher] make more pointers to the UI std::unique_ptr

addendum to PR #4362

(Same as PR #4293, just for Sketcher

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all Sketcher dialogs that don't already use a unique_ptr.)
This commit is contained in:
donovaly
2021-02-05 01:38:34 +01:00
committed by wmayer
parent 9c3c562f7b
commit 65656f6d22
10 changed files with 8 additions and 14 deletions

View File

@@ -49,7 +49,6 @@ SketchMirrorDialog::SketchMirrorDialog(void)
SketchMirrorDialog::~SketchMirrorDialog()
{
delete ui;
}
void SketchMirrorDialog::accept()

View File

@@ -43,7 +43,7 @@ public:
void accept();
private:
Ui_SketchMirrorDialog* ui;
std::unique_ptr<Ui_SketchMirrorDialog> ui;
};
}

View File

@@ -52,7 +52,6 @@ SketchOrientationDialog::SketchOrientationDialog(void)
SketchOrientationDialog::~SketchOrientationDialog()
{
delete ui;
}
void SketchOrientationDialog::accept()

View File

@@ -46,7 +46,7 @@ protected Q_SLOTS:
void onPreview();
private:
Ui_SketchOrientationDialog* ui;
std::unique_ptr<Ui_SketchOrientationDialog> ui;
};
}

View File

@@ -53,7 +53,6 @@ SketchRectangularArrayDialog::SketchRectangularArrayDialog(void)
SketchRectangularArrayDialog::~SketchRectangularArrayDialog()
{
delete ui;
}
void SketchRectangularArrayDialog::accept()

View File

@@ -48,7 +48,7 @@ public:
protected:
void updateValues(void);
private:
Ui_SketchRectangularArrayDialog* ui;
std::unique_ptr<Ui_SketchRectangularArrayDialog> ui;
};
}

View File

@@ -49,7 +49,6 @@ SketcherRegularPolygonDialog::SketcherRegularPolygonDialog(void)
SketcherRegularPolygonDialog::~SketcherRegularPolygonDialog()
{
delete ui;
}
void SketcherRegularPolygonDialog::accept()

View File

@@ -44,7 +44,7 @@ public:
protected:
void updateValues(void);
private:
Ui_SketcherRegularPolygonDialog* ui;
std::unique_ptr<Ui_SketcherRegularPolygonDialog> ui;
};
}

View File

@@ -62,7 +62,6 @@ SketcherSettings::SketcherSettings(QWidget* parent)
SketcherSettings::~SketcherSettings()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void SketcherSettings::saveSettings()
@@ -141,7 +140,6 @@ SketcherSettingsDisplay::SketcherSettingsDisplay(QWidget* parent)
SketcherSettingsDisplay::~SketcherSettingsDisplay()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void SketcherSettingsDisplay::saveSettings()
@@ -241,7 +239,6 @@ SketcherSettingsColors::SketcherSettingsColors(QWidget* parent)
SketcherSettingsColors::~SketcherSettingsColors()
{
// no need to delete child widgets, Qt does it all for us
delete ui;
}
void SketcherSettingsColors::saveSettings()

View File

@@ -25,6 +25,7 @@
#define SKETCHERGUI_SKETCHERSETTINGS_H
#include <Gui/PropertyPage.h>
#include <memory>
namespace SketcherGui {
class Ui_SketcherSettings;
@@ -50,7 +51,7 @@ protected:
void changeEvent(QEvent *e);
private:
Ui_SketcherSettings* ui;
std::unique_ptr<Ui_SketcherSettings> ui;
SketcherGeneralWidget* form;
};
@@ -76,7 +77,7 @@ private Q_SLOTS:
void onBtnTVApplyClicked(bool);
private:
Ui_SketcherSettingsDisplay* ui;
std::unique_ptr<Ui_SketcherSettingsDisplay> ui;
};
/**
@@ -98,7 +99,7 @@ protected:
void changeEvent(QEvent *e);
private:
Ui_SketcherSettingsColors* ui;
std::unique_ptr<Ui_SketcherSettingsColors> ui;
};
} // namespace SketcherGui