CLayerEditor: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 03:57:06 -04:00
parent 86bca47221
commit d537cfd4b2
2 changed files with 5 additions and 9 deletions

View File

@ -6,9 +6,8 @@
CLayerEditor::CLayerEditor(QWidget *parent)
: QDialog(parent)
, ui(new Ui::CLayerEditor)
, mpArea(nullptr)
, mpModel(new CLayerModel(this))
, ui(std::make_unique<Ui::CLayerEditor>())
{
ui->setupUi(this);
ui->LayerSelectComboBox->setModel(mpModel);
@ -18,10 +17,7 @@ CLayerEditor::CLayerEditor(QWidget *parent)
connect(ui->ActiveCheckBox, SIGNAL(toggled(bool)), this, SLOT(EditLayerActive(bool)));
}
CLayerEditor::~CLayerEditor()
{
delete ui;
}
CLayerEditor::~CLayerEditor() = default;
void CLayerEditor::SetArea(CGameArea *pArea)
{

View File

@ -13,10 +13,10 @@ class CLayerEditor : public QDialog
Q_OBJECT
TResPtr<CGameArea> mpArea;
CLayerModel *mpModel;
CScriptLayer *mpCurrentLayer;
CScriptLayer *mpCurrentLayer = nullptr;
public:
explicit CLayerEditor(QWidget *parent = 0);
explicit CLayerEditor(QWidget *parent = nullptr);
~CLayerEditor();
void SetArea(CGameArea *pArea);
@ -26,7 +26,7 @@ public slots:
void EditLayerActive(bool Active);
private:
Ui::CLayerEditor *ui;
std::unique_ptr<Ui::CLayerEditor> ui;
};
#endif // CLAYEREDITOR_H