diff --git a/examples/corelib/serialization/savegame/character.cpp b/examples/corelib/serialization/savegame/character.cpp index 43be084d3e..7be737f308 100644 --- a/examples/corelib/serialization/savegame/character.cpp +++ b/examples/corelib/serialization/savegame/character.cpp @@ -6,10 +6,8 @@ #include #include -Character::Character() : - mLevel(0), - mClassType(Warrior) { -} +Character::Character() + = default; Character::Character(const QString &name, int level, diff --git a/examples/corelib/serialization/savegame/character.h b/examples/corelib/serialization/savegame/character.h index 4121c29aff..4dc25139a6 100644 --- a/examples/corelib/serialization/savegame/character.h +++ b/examples/corelib/serialization/savegame/character.h @@ -37,8 +37,8 @@ public: void print(int indentation = 0) const; private: QString mName; - int mLevel; - ClassType mClassType; + int mLevel = 0; + ClassType mClassType = Warrior; }; //! [0]