diff --git a/src/Editor/WorldEditor/CInstancesModel.cpp b/src/Editor/WorldEditor/CInstancesModel.cpp index 1068ac5c..f0cc8a4b 100644 --- a/src/Editor/WorldEditor/CInstancesModel.cpp +++ b/src/Editor/WorldEditor/CInstancesModel.cpp @@ -31,11 +31,6 @@ CInstancesModel::CInstancesModel(CWorldEditor *pEditor, QObject *pParent) : QAbstractItemModel(pParent) , mpEditor(pEditor) , mpScene(pEditor->Scene()) - , mpArea(nullptr) - , mpCurrentGame(nullptr) - , mModelType(EInstanceModelType::Layers) - , mShowColumnEnabled(true) - , mChangingLayout(false) { mBaseItems << "Script"; @@ -50,9 +45,7 @@ CInstancesModel::CInstancesModel(CWorldEditor *pEditor, QObject *pParent) connect(mpEditor, SIGNAL(InstancesLayerChanged(QList)), this, SLOT(InstancesLayerPostChange(QList))); } -CInstancesModel::~CInstancesModel() -{ -} +CInstancesModel::~CInstancesModel() = default; QVariant CInstancesModel::headerData(int Section, Qt::Orientation Orientation, int Role) const { diff --git a/src/Editor/WorldEditor/CInstancesModel.h b/src/Editor/WorldEditor/CInstancesModel.h index ad4da1b4..b023cee9 100644 --- a/src/Editor/WorldEditor/CInstancesModel.h +++ b/src/Editor/WorldEditor/CInstancesModel.h @@ -27,23 +27,24 @@ public: private: CWorldEditor *mpEditor; CScene *mpScene; - CGameArea *mpArea; - CGameTemplate *mpCurrentGame; - EInstanceModelType mModelType; + CGameArea *mpArea = nullptr; + CGameTemplate *mpCurrentGame = nullptr; + EInstanceModelType mModelType{EInstanceModelType::Layers}; QList mTemplateList; QStringList mBaseItems; - bool mShowColumnEnabled; - bool mChangingLayout; + bool mShowColumnEnabled = true; + bool mChangingLayout = false; public: - explicit CInstancesModel(CWorldEditor *pEditor, QObject *pParent = 0); - ~CInstancesModel(); - QVariant headerData(int Section, Qt::Orientation Orientation, int Role) const; - QModelIndex index(int Row, int Column, const QModelIndex& rkParent = QModelIndex()) const; - QModelIndex parent(const QModelIndex& rkChild) const; - int rowCount(const QModelIndex& rkParent) const; - int columnCount(const QModelIndex& rkParent) const; - QVariant data(const QModelIndex& rkIndex, int Role) const; + explicit CInstancesModel(CWorldEditor *pEditor, QObject *pParent = nullptr); + ~CInstancesModel() override; + + QVariant headerData(int Section, Qt::Orientation Orientation, int Role) const override; + QModelIndex index(int Row, int Column, const QModelIndex& rkParent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex& rkChild) const override; + int rowCount(const QModelIndex& rkParent) const override; + int columnCount(const QModelIndex& rkParent) const override; + QVariant data(const QModelIndex& rkIndex, int Role) const override; void SetModelType(EInstanceModelType Type); void SetShowColumnEnabled(bool Enabled);