Refactoring.

This commit is contained in:
Roman Telezhynskyi 2023-01-16 11:40:21 +02:00
parent f0db72c89b
commit 32f6b1be3e
2 changed files with 11 additions and 31 deletions

View file

@ -433,32 +433,7 @@ auto PrepareLines(const QVector<VLabelTemplateLine> &lines) -> QVector<TextLine>
return textLines;
}
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief VTextManager::VTextManager constructor
*/
VTextManager::VTextManager()
: m_font(), m_liLines()
{}
//---------------------------------------------------------------------------------------------------------------------
VTextManager::VTextManager(const VTextManager &text)
: m_font(text.GetFont()), m_liLines(text.GetAllSourceLines())
{}
//---------------------------------------------------------------------------------------------------------------------
VTextManager &VTextManager::operator=(const VTextManager &text)
{
if ( &text == this )
{
return *this;
}
m_font = text.GetFont();
m_liLines = text.GetAllSourceLines();
return *this;
}
} // namespace
//---------------------------------------------------------------------------------------------------------------------
/**

View file

@ -72,11 +72,16 @@ class VTextManager
{
Q_DECLARE_TR_FUNCTIONS(VTextManager) // NOLINT
public:
VTextManager();
VTextManager() = default;
virtual ~VTextManager() = default;
VTextManager(const VTextManager &text);
VTextManager &operator=(const VTextManager &text);
VTextManager(const VTextManager &text) = default;
auto operator=(const VTextManager &text) -> VTextManager & = default;
#ifdef Q_COMPILER_RVALUE_REFS
VTextManager(VTextManager &&text) Q_DECL_NOTHROW = default;
auto operator=(VTextManager &&text) Q_DECL_NOTHROW -> VTextManager & = default;
#endif
virtual auto GetSpacing() const -> int;
@ -99,8 +104,8 @@ public:
friend auto operator>>(QDataStream& dataStream, VTextManager& data) -> QDataStream&;
private:
QFont m_font;
QVector<TextLine> m_liLines;
QFont m_font{};
QVector<TextLine> m_liLines{};
static const quint32 streamHeader;
static const quint16 classVersion;