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; return textLines;
} }
} } // namespace
//---------------------------------------------------------------------------------------------------------------------
/**
* @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;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**

View File

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