[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:
@@ -49,7 +49,6 @@ SketchMirrorDialog::SketchMirrorDialog(void)
|
||||
|
||||
SketchMirrorDialog::~SketchMirrorDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SketchMirrorDialog::accept()
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
void accept();
|
||||
|
||||
private:
|
||||
Ui_SketchMirrorDialog* ui;
|
||||
std::unique_ptr<Ui_SketchMirrorDialog> ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ SketchOrientationDialog::SketchOrientationDialog(void)
|
||||
|
||||
SketchOrientationDialog::~SketchOrientationDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SketchOrientationDialog::accept()
|
||||
|
||||
@@ -46,7 +46,7 @@ protected Q_SLOTS:
|
||||
void onPreview();
|
||||
|
||||
private:
|
||||
Ui_SketchOrientationDialog* ui;
|
||||
std::unique_ptr<Ui_SketchOrientationDialog> ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ SketchRectangularArrayDialog::SketchRectangularArrayDialog(void)
|
||||
|
||||
SketchRectangularArrayDialog::~SketchRectangularArrayDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SketchRectangularArrayDialog::accept()
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
protected:
|
||||
void updateValues(void);
|
||||
private:
|
||||
Ui_SketchRectangularArrayDialog* ui;
|
||||
std::unique_ptr<Ui_SketchRectangularArrayDialog> ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@ SketcherRegularPolygonDialog::SketcherRegularPolygonDialog(void)
|
||||
|
||||
SketcherRegularPolygonDialog::~SketcherRegularPolygonDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SketcherRegularPolygonDialog::accept()
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
protected:
|
||||
void updateValues(void);
|
||||
private:
|
||||
Ui_SketcherRegularPolygonDialog* ui;
|
||||
std::unique_ptr<Ui_SketcherRegularPolygonDialog> ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user