[PD] make pointers to the UI std::unique_ptr

Same as PR #4293, just for PartDesign

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 PartDesign dialogs that don't already use a unique_ptr.
This commit is contained in:
donovaly
2021-02-05 02:45:37 +01:00
committed by wmayer
parent a544951dcd
commit 2ac84872ec
40 changed files with 74 additions and 101 deletions

View File

@@ -72,11 +72,11 @@ using namespace Gui;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskPipeParameters::TaskPipeParameters(ViewProviderPipe *PipeView, bool /*newObj*/, QWidget *parent)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_Additive_Pipe",tr("Pipe parameters"))
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_Additive_Pipe", tr("Pipe parameters"))
, ui(new Ui_TaskPipeParameters)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
ui = new Ui_TaskPipeParameters();
ui->setupUi(proxy);
QMetaObject::connectSlotsByName(this);
@@ -163,8 +163,6 @@ TaskPipeParameters::~TaskPipeParameters()
// getDocument() may raise an exception
e.ReportException();
}
delete ui;
}
void TaskPipeParameters::updateUI()
@@ -441,11 +439,11 @@ void TaskPipeParameters::exitSelectionMode() {
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskPipeOrientation::TaskPipeOrientation(ViewProviderPipe* PipeView, bool /*newObj*/, QWidget* parent)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_Additive_Pipe", tr("Section orientation")) {
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_Additive_Pipe", tr("Section orientation")),
ui(new Ui_TaskPipeOrientation)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
ui = new Ui_TaskPipeOrientation();
ui->setupUi(proxy);
QMetaObject::connectSlotsByName(this);
@@ -768,11 +766,11 @@ void TaskPipeOrientation::updateUI(int idx) {
// Task Scaling
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TaskPipeScaling::TaskPipeScaling(ViewProviderPipe* PipeView, bool /*newObj*/, QWidget* parent)
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_Additive_Pipe", tr("Section transformation"))
: TaskSketchBasedParameters(PipeView, parent, "PartDesign_Additive_Pipe", tr("Section transformation")),
ui(new Ui_TaskPipeScaling)
{
// we need a separate container widget to add all controls to
proxy = new QWidget(this);
ui = new Ui_TaskPipeScaling();
ui->setupUi(proxy);
QMetaObject::connectSlotsByName(this);