diff --git a/src/Mod/PartDesign/Gui/DlgActiveBody.cpp b/src/Mod/PartDesign/Gui/DlgActiveBody.cpp index fb4841d94f..07bcd2ad02 100644 --- a/src/Mod/PartDesign/Gui/DlgActiveBody.cpp +++ b/src/Mod/PartDesign/Gui/DlgActiveBody.cpp @@ -31,29 +31,28 @@ #include #include +#include "ui_DlgActiveBody.h" #include "DlgActiveBody.h" #include "ReferenceSelection.h" #include "Utils.h" -Q_DECLARE_METATYPE(App::DocumentObject*); +Q_DECLARE_METATYPE(App::DocumentObject*) using namespace PartDesignGui; -DlgActiveBody::DlgActiveBody(QWidget *parent, App::Document*& doc, - const QString& infoText) - : QDialog(parent), - ui(new Ui_DlgActiveBody), - _doc(doc), - activeBody(nullptr) +DlgActiveBody::DlgActiveBody(QWidget *parent, App::Document*& doc, const QString& infoText) + : QDialog(parent) + , ui(new Ui_DlgActiveBody) + , _doc(doc) + , activeBody(nullptr) { ui->setupUi(this); - QObject::connect(ui->bodySelect, SIGNAL(itemDoubleClicked(QListWidgetItem *)), - this, SLOT(accept())); + connect(ui->bodySelect, SIGNAL(itemDoubleClicked(QListWidgetItem *)), + this, SLOT(accept())); - if(!infoText.isEmpty()) { - ui->label->setText(infoText + QString::fromUtf8("\n\n") + - QObject::tr("Please select")); + if (!infoText.isEmpty()) { + ui->label->setText(infoText + QString::fromUtf8("\n\n") + tr("Please select")); } auto bodies = _doc->getObjectsOfType(PartDesign::Body::getClassTypeId()); @@ -85,6 +84,10 @@ DlgActiveBody::DlgActiveBody(QWidget *parent, App::Document*& doc, } } +DlgActiveBody::~DlgActiveBody() +{ +} + void DlgActiveBody::accept() { auto selectedItems = ui->bodySelect->selectedItems(); diff --git a/src/Mod/PartDesign/Gui/DlgActiveBody.h b/src/Mod/PartDesign/Gui/DlgActiveBody.h index c73f3c8bcd..d0ccf61139 100644 --- a/src/Mod/PartDesign/Gui/DlgActiveBody.h +++ b/src/Mod/PartDesign/Gui/DlgActiveBody.h @@ -26,13 +26,15 @@ #ifndef PARTDESIGNGUI_DLGACTIVEBODY_H #define PARTDESIGNGUI_DLGACTIVEBODY_H +#include +#include #include #include +#include -// TODO: Apparently this header can be avoided. See ./Command.cpp:74. -#include "ui_DlgActiveBody.h" namespace PartDesignGui { +class Ui_DlgActiveBody; /** Dialog box to ask user to pick a Part Design body to make active * or make a new one @@ -44,9 +46,10 @@ class PartDesignGuiExport DlgActiveBody : public QDialog public: DlgActiveBody(QWidget* parent, App::Document*& doc, const QString& infoText=QString()); + ~DlgActiveBody(); void accept() override; - PartDesign::Body* getActiveBody() { return activeBody; }; + PartDesign::Body* getActiveBody() const { return activeBody; } private: std::unique_ptr ui;