WInstancesTab: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 06:59:12 -04:00
parent 719fed015e
commit a3bfb3cc7c
2 changed files with 7 additions and 8 deletions

View File

@ -9,7 +9,7 @@
WInstancesTab::WInstancesTab(CWorldEditor *pEditor, QWidget *parent) :
QWidget(parent),
ui(new Ui::WInstancesTab)
ui(std::make_unique<Ui::WInstancesTab>())
{
ui->setupUi(this);
@ -74,10 +74,7 @@ WInstancesTab::WInstancesTab(CWorldEditor *pEditor, QWidget *parent) :
connect(mpUnhideAll, SIGNAL(triggered()), this, SLOT(OnUnhideAll()));
}
WInstancesTab::~WInstancesTab()
{
delete ui;
}
WInstancesTab::~WInstancesTab() = default;
// ************ PRIVATE SLOTS ************
void WInstancesTab::OnTreeClick(QModelIndex Index)

View File

@ -8,6 +8,8 @@
#include <QAction>
#include <QMenu>
#include <memory>
class CWorldEditor;
class CScene;
@ -43,8 +45,8 @@ class WInstancesTab : public QWidget
CInstancesModel::EIndexType mMenuIndexType;
public:
explicit WInstancesTab(CWorldEditor *pEditor, QWidget *parent = 0);
~WInstancesTab();
explicit WInstancesTab(CWorldEditor *pEditor, QWidget *parent = nullptr);
~WInstancesTab() override;
private slots:
void OnTreeClick(QModelIndex Index);
@ -61,7 +63,7 @@ private slots:
void ExpandTopLevelItems();
private:
Ui::WInstancesTab *ui;
std::unique_ptr<Ui::WInstancesTab> ui;
};
#endif // WINSTANCESTAB_H