From d5f7699f34d89198cb4301aba07cfab38a599b73 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Jun 2020 06:56:08 -0400 Subject: [PATCH] WEditorProperties: Make use of in-class initializers where applicable --- src/Editor/WorldEditor/WEditorProperties.cpp | 5 +---- src/Editor/WorldEditor/WEditorProperties.h | 9 +++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Editor/WorldEditor/WEditorProperties.cpp b/src/Editor/WorldEditor/WEditorProperties.cpp index 802ed9ef..b67a9221 100644 --- a/src/Editor/WorldEditor/WEditorProperties.cpp +++ b/src/Editor/WorldEditor/WEditorProperties.cpp @@ -2,11 +2,8 @@ #include "Editor/Undo/CEditScriptPropertyCommand.h" #include -WEditorProperties::WEditorProperties(QWidget *pParent /*= 0*/) +WEditorProperties::WEditorProperties(QWidget *pParent) : QWidget(pParent) - , mpEditor(nullptr) - , mpDisplayNode(nullptr) - , mHasEditedName(false) { mpInstanceInfoLabel = new QLabel; mpInstanceInfoLabel->setText("[No selection]"); diff --git a/src/Editor/WorldEditor/WEditorProperties.h b/src/Editor/WorldEditor/WEditorProperties.h index eda69059..8504def4 100644 --- a/src/Editor/WorldEditor/WEditorProperties.h +++ b/src/Editor/WorldEditor/WEditorProperties.h @@ -14,8 +14,8 @@ class WEditorProperties : public QWidget { Q_OBJECT - CWorldEditor* mpEditor; - CSceneNode* mpDisplayNode; + CWorldEditor* mpEditor = nullptr; + CSceneNode* mpDisplayNode = nullptr; QVBoxLayout* mpMainLayout; @@ -30,10 +30,11 @@ class WEditorProperties : public QWidget QComboBox* mpLayersComboBox; QHBoxLayout* mpLayersLayout; - bool mHasEditedName; + bool mHasEditedName = false; public: - WEditorProperties(QWidget* pParent = 0); + explicit WEditorProperties(QWidget* pParent = nullptr); + void SyncToEditor(CWorldEditor* pEditor); void SetLayerComboBox();