Code style.

This commit is contained in:
Roman Telezhynskyi 2022-02-18 10:15:34 +02:00
parent c0e45c85fe
commit 4c73ab529a
4 changed files with 30 additions and 22 deletions

View File

@ -503,7 +503,7 @@ auto VPPiece::IsValid() const -> bool
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
quint16 VPPiece::CopyNumber() const auto VPPiece::CopyNumber() const -> quint16
{ {
return m_copyNumber; return m_copyNumber;
} }

View File

@ -36,6 +36,10 @@
#include "../vlayout/vlayoutpiece.h" #include "../vlayout/vlayoutpiece.h"
#include "../layout/layoutdef.h" #include "../layout/layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VPLayout; class VPLayout;
class VPSheet; class VPSheet;
@ -44,12 +48,11 @@ class VPPiece : public VLayoutPiece
public: public:
VPPiece() = default; VPPiece() = default;
explicit VPPiece(const VLayoutPiece &layoutPiece); explicit VPPiece(const VLayoutPiece &layoutPiece);
virtual ~VPPiece() = default; ~VPPiece() override = default;
void Update(const VPPiecePtr &piece); void Update(const VPPiecePtr &piece);
virtual auto GetUniqueID() const -> QString override; auto GetUniqueID() const -> QString override;
void ClearTransformations(); void ClearTransformations();
@ -126,7 +129,7 @@ public:
void SetCopyNumber(quint16 newCopyNumber); void SetCopyNumber(quint16 newCopyNumber);
private: private:
Q_DISABLE_COPY(VPPiece) Q_DISABLE_COPY_MOVE(VPPiece) // NOLINT
VPLayoutWeakPtr m_layout{}; VPLayoutWeakPtr m_layout{};
@ -200,6 +203,6 @@ inline void VPPiece::SetHasSuperpositionWithPieces(bool newHasSuperpositionWithP
m_hasSuperpositionWithPieces = newHasSuperpositionWithPieces; m_hasSuperpositionWithPieces = newHasSuperpositionWithPieces;
} }
Q_DECLARE_METATYPE(VPPiecePtr) Q_DECLARE_METATYPE(VPPiecePtr) // NOLINT
#endif // VPPIECE_H #endif // VPPIECE_H

View File

@ -140,7 +140,7 @@ void VPSheetSceneData::PrepareForExport()
VPSheetPtr sheet = layout->GetSheet(m_sheetUuid); VPSheetPtr sheet = layout->GetSheet(m_sheetUuid);
m_slectedPiecesTmp = sheet->GetSelectedPieces(); m_slectedPiecesTmp = sheet->GetSelectedPieces();
for (const auto& piece : m_slectedPiecesTmp) for (const auto& piece : qAsConst(m_slectedPiecesTmp))
{ {
if (not piece.isNull()) if (not piece.isNull())
{ {
@ -171,7 +171,7 @@ void VPSheetSceneData::CleanAfterExport()
layout->LayoutSettings().SetShowGrid(m_showGridTmp); layout->LayoutSettings().SetShowGrid(m_showGridTmp);
layout->LayoutSettings().SetShowTiles(m_showTilesTmp); layout->LayoutSettings().SetShowTiles(m_showTilesTmp);
for (const auto& piece : m_slectedPiecesTmp) for (const auto& piece : qAsConst(m_slectedPiecesTmp))
{ {
if (not piece.isNull()) if (not piece.isNull())
{ {
@ -319,7 +319,8 @@ void VPSheetSceneData::ConnectPiece(VPGraphicsPiece *piece)
// VPSheet // VPSheet
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPSheet::VPSheet(const VPLayoutPtr &layout) : VPSheet::VPSheet(const VPLayoutPtr &layout, QObject *parent)
: QObject(parent),
m_layout(layout), m_layout(layout),
m_sceneData(new VPSheetSceneData(layout, Uuid())) m_sceneData(new VPSheetSceneData(layout, Uuid()))
{ {
@ -574,7 +575,7 @@ void VPSheet::ValidatePiecesOutOfBound() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto VPSheet::GetSheetRect() const -> QRectF auto VPSheet::GetSheetRect() const -> QRectF
{ {
return QRectF(QPoint(0, 0), m_size); return {QPoint(0, 0), m_size};
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -587,7 +588,7 @@ auto VPSheet::GetMarginsRect() const -> QRectF
return rect; return rect;
} }
return QRectF(0, 0, m_size.width(), m_size.height()); return {0, 0, m_size.width(), m_size.height()};
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -37,6 +37,10 @@
#include "def.h" #include "def.h"
#include "layoutdef.h" #include "layoutdef.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
class VPLayout; class VPLayout;
class VPPiece; class VPPiece;
class VMainGraphicsScene; class VMainGraphicsScene;
@ -53,7 +57,7 @@ public:
explicit VPSheetSceneData(const VPLayoutPtr &layout, const QUuid &sheetUuid); explicit VPSheetSceneData(const VPLayoutPtr &layout, const QUuid &sheetUuid);
~VPSheetSceneData(); ~VPSheetSceneData();
VMainGraphicsScene *Scene() const; auto Scene() const -> VMainGraphicsScene *;
/** /**
* @brief RefreshLayout Refreshes the rectangles for the layout border and the margin * @brief RefreshLayout Refreshes the rectangles for the layout border and the margin
@ -90,7 +94,7 @@ public:
void RefreshSheetSize(); void RefreshSheetSize();
private: private:
Q_DISABLE_COPY(VPSheetSceneData) Q_DISABLE_COPY_MOVE(VPSheetSceneData) // NOLINT
VPLayoutWeakPtr m_layout{}; VPLayoutWeakPtr m_layout{};
@ -130,11 +134,11 @@ private:
class VPSheet : public QObject class VPSheet : public QObject
{ {
Q_OBJECT Q_OBJECT // NOLINT
public: public:
explicit VPSheet(const VPLayoutPtr &layout); explicit VPSheet(const VPLayoutPtr &layout, QObject *parent = nullptr);
virtual ~VPSheet() = default; ~VPSheet() override = default;
/** /**
* @brief GetLayout Returns the Layout of the sheet * @brief GetLayout Returns the Layout of the sheet
@ -162,7 +166,7 @@ public:
auto Uuid() const -> const QUuid &; auto Uuid() const -> const QUuid &;
bool IsVisible() const; auto IsVisible() const -> bool;
void SetVisible(bool visible); void SetVisible(bool visible);
auto GrainlineOrientation() const -> GrainlineType; auto GrainlineOrientation() const -> GrainlineType;
@ -268,7 +272,7 @@ public:
auto IgnoreMargins() const -> bool; auto IgnoreMargins() const -> bool;
void SetIgnoreMargins(bool newIgnoreMargins); void SetIgnoreMargins(bool newIgnoreMargins);
VPSheetSceneData *SceneData() const; auto SceneData() const -> VPSheetSceneData *;
void ClearSelection() const; void ClearSelection() const;
@ -278,7 +282,7 @@ public slots:
void CheckPiecePositionValidity(const VPPiecePtr &piece) const; void CheckPiecePositionValidity(const VPPiecePtr &piece) const;
private: private:
Q_DISABLE_COPY(VPSheet) Q_DISABLE_COPY_MOVE(VPSheet) // NOLINT
VPLayoutWeakPtr m_layout{}; VPLayoutWeakPtr m_layout{};
@ -312,6 +316,6 @@ private:
}; };
Q_DECLARE_METATYPE(VPSheetPtr) Q_DECLARE_METATYPE(VPSheetPtr) // NOLINT
#endif // VPSHEET_H #endif // VPSHEET_H