diff --git a/src/Editor/WorldEditor/WModifyTab.cpp b/src/Editor/WorldEditor/WModifyTab.cpp index a4154353..6be4c8a3 100644 --- a/src/Editor/WorldEditor/WModifyTab.cpp +++ b/src/Editor/WorldEditor/WModifyTab.cpp @@ -12,8 +12,7 @@ WModifyTab::WModifyTab(CWorldEditor *pEditor, QWidget *pParent) : QWidget(pParent) - , ui(new Ui::WModifyTab) - , mIsPicking(false) + , ui(std::make_unique()) { ui->setupUi(this); ui->PropertyView->SetEditor(pEditor); @@ -25,8 +24,8 @@ WModifyTab::WModifyTab(CWorldEditor *pEditor, QWidget *pParent) mpOutLinkModel = new CLinkModel(this); mpOutLinkModel->SetConnectionType(ELinkType::Outgoing); - mpAddFromViewportAction = new QAction("Choose from viewport", this); - mpAddFromListAction = new QAction("Choose from list", this); + mpAddFromViewportAction = new QAction(tr("Choose from viewport"), this); + mpAddFromListAction = new QAction(tr("Choose from list"), this); mpAddLinkMenu = new QMenu(this); mpAddLinkMenu->addAction(mpAddFromViewportAction); mpAddLinkMenu->addAction(mpAddFromListAction); @@ -54,10 +53,7 @@ WModifyTab::WModifyTab(CWorldEditor *pEditor, QWidget *pParent) ClearUI(); } -WModifyTab::~WModifyTab() -{ - delete ui; -} +WModifyTab::~WModifyTab() = default; void WModifyTab::ClearUI() { diff --git a/src/Editor/WorldEditor/WModifyTab.h b/src/Editor/WorldEditor/WModifyTab.h index 3f7e8328..6d7f2055 100644 --- a/src/Editor/WorldEditor/WModifyTab.h +++ b/src/Editor/WorldEditor/WModifyTab.h @@ -12,6 +12,8 @@ #include #include +#include + class CWorldEditor; namespace Ui { @@ -32,11 +34,12 @@ class WModifyTab : public QWidget QAction *mpAddFromViewportAction; QAction *mpAddFromListAction; ELinkType mAddLinkType; - bool mIsPicking; + bool mIsPicking = false; public: - explicit WModifyTab(CWorldEditor *pEditor, QWidget *pParent = 0); - ~WModifyTab(); + explicit WModifyTab(CWorldEditor *pEditor, QWidget *pParent = nullptr); + ~WModifyTab() override; + void ClearUI(); CPropertyView* PropertyView() const; @@ -53,11 +56,11 @@ public slots: void OnDeleteLinksClicked(); void OnEditLinkClicked(); - inline bool IsPicking() const { return mIsPicking; } - inline CSceneNode* EditNode() const { return mpSelectedNode; } + bool IsPicking() const { return mIsPicking; } + CSceneNode* EditNode() const { return mpSelectedNode; } private: - Ui::WModifyTab *ui; + std::unique_ptr ui; private slots: void OnLinkTableDoubleClick(QModelIndex Index);