diff --git a/src/app/puzzle/vpuzzlelayer.cpp b/src/app/puzzle/vpuzzlelayer.cpp index a50ac7d3c..174a161a9 100644 --- a/src/app/puzzle/vpuzzlelayer.cpp +++ b/src/app/puzzle/vpuzzlelayer.cpp @@ -61,7 +61,7 @@ void VPuzzleLayer::RemovePiece(VPuzzlePiece *piece) } //--------------------------------------------------------------------------------------------------------------------- -QString VPuzzleLayer::GetName() +QString VPuzzleLayer::GetName() const { return m_name; } @@ -79,7 +79,7 @@ void VPuzzleLayer::SetIsVisible(bool value) } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayer::GetIsVisible() +bool VPuzzleLayer::GetIsVisible() const { return m_isVisible; } diff --git a/src/app/puzzle/vpuzzlelayer.h b/src/app/puzzle/vpuzzlelayer.h index b4fc20038..c11759d15 100644 --- a/src/app/puzzle/vpuzzlelayer.h +++ b/src/app/puzzle/vpuzzlelayer.h @@ -44,11 +44,11 @@ public: // here add some more function if we want to add/move a piece at a // certain position in the list - QString GetName(); + QString GetName() const; void SetName(QString name); void SetIsVisible(bool value); - bool GetIsVisible(); + bool GetIsVisible() const; private: QString m_name; diff --git a/src/app/puzzle/vpuzzlelayout.cpp b/src/app/puzzle/vpuzzlelayout.cpp index 94a17547d..4708ba21a 100644 --- a/src/app/puzzle/vpuzzlelayout.cpp +++ b/src/app/puzzle/vpuzzlelayout.cpp @@ -83,7 +83,7 @@ void VPuzzleLayout::SetUnit(Unit unit) } //--------------------------------------------------------------------------------------------------------------------- -Unit VPuzzleLayout::getUnit() +Unit VPuzzleLayout::getUnit() const { return m_unit; } @@ -118,13 +118,13 @@ void VPuzzleLayout::SetLayoutSizeConverted(QSizeF size) } //--------------------------------------------------------------------------------------------------------------------- -QSizeF VPuzzleLayout::GetLayoutSize() +QSizeF VPuzzleLayout::GetLayoutSize() const { return m_size; } //--------------------------------------------------------------------------------------------------------------------- -QSizeF VPuzzleLayout::GetLayoutSizeConverted() +QSizeF VPuzzleLayout::GetLayoutSizeConverted() const { QSizeF convertedSize = QSizeF( UnitConvertor(m_size.width(), Unit::Px, m_unit), @@ -164,13 +164,13 @@ void VPuzzleLayout::SetLayoutMarginsConverted(QMarginsF margins) } //--------------------------------------------------------------------------------------------------------------------- -QMarginsF VPuzzleLayout::GetLayoutMargins() +QMarginsF VPuzzleLayout::GetLayoutMargins() const { return m_margins; } //--------------------------------------------------------------------------------------------------------------------- -QMarginsF VPuzzleLayout::GetLayoutMarginsConverted() +QMarginsF VPuzzleLayout::GetLayoutMarginsConverted() const { return UnitConvertor(m_margins, Unit::Px, m_unit); } @@ -200,13 +200,13 @@ void VPuzzleLayout::SetPiecesGapConverted(qreal value) } //--------------------------------------------------------------------------------------------------------------------- -qreal VPuzzleLayout::GetPiecesGap() +qreal VPuzzleLayout::GetPiecesGap() const { return m_piecesGap; } //--------------------------------------------------------------------------------------------------------------------- -qreal VPuzzleLayout::GetPiecesGapConverted() +qreal VPuzzleLayout::GetPiecesGapConverted() const { return UnitConvertor(m_piecesGap, Unit::Px, m_unit); } @@ -219,7 +219,7 @@ void VPuzzleLayout::SetWarningSuperpositionOfPieces(bool state) } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayout::GetWarningSuperpositionOfPieces() +bool VPuzzleLayout::GetWarningSuperpositionOfPieces() const { return m_warningSuperpositionOfPieces; } @@ -231,7 +231,7 @@ void VPuzzleLayout::SetWarningPiecesOutOfBound(bool state) } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayout::GetWarningPiecesOutOfBound() +bool VPuzzleLayout::GetWarningPiecesOutOfBound() const { return m_warningPiecesOutOfBound; } @@ -243,7 +243,7 @@ void VPuzzleLayout::SetStickyEdges(bool state) } //--------------------------------------------------------------------------------------------------------------------- -bool VPuzzleLayout::GetStickyEdges() +bool VPuzzleLayout::GetStickyEdges() const { return m_stickyEdges; } diff --git a/src/app/puzzle/vpuzzlelayout.h b/src/app/puzzle/vpuzzlelayout.h index be8e198f8..d20510013 100644 --- a/src/app/puzzle/vpuzzlelayout.h +++ b/src/app/puzzle/vpuzzlelayout.h @@ -51,7 +51,7 @@ public: QList GetLayers(); void SetUnit(Unit unit); - Unit getUnit(); + Unit getUnit() const; /** * @brief SetLayoutSize sets the size of the layout, the values have to be in Unit::Px @@ -71,24 +71,24 @@ public: * @brief SetLayoutSize sets the size of the layout, the values have to be in Unit::Px * @param size */ - void SetLayoutSize(QSizeF size); + void SetLayoutSize(const QSizeF &size); /** * @brief SetLayoutSizeConverted sets the size of the layout, the values have to be in the layout's unit * @param size */ - void SetLayoutSizeConverted(QSizeF size); + void SetLayoutSizeConverted(const QSizeF &size); /** * @brief GetLayoutSize Returns the size in Unit::Px * @return */ - QSizeF GetLayoutSize(); + QSizeF GetLayoutSize() const; /** * @brief GetLayoutSizeConverted Returns the size in the layout's unit * @return */ - QSizeF GetLayoutSizeConverted(); + QSizeF GetLayoutSizeConverted() const; /** * @brief SetLayoutMargins, set the margins of the layout, the values have to be in Unit::Px @@ -124,13 +124,13 @@ public: * @brief GetLayoutMargins Returns the size in Unit::Px * @return */ - QMarginsF GetLayoutMargins(); + QMarginsF GetLayoutMargins() const; /** * @brief GetLayoutMarginsConverted Returns the margins in the layout's unit * @return */ - QMarginsF GetLayoutMarginsConverted(); + QMarginsF GetLayoutMarginsConverted() const; void SetFollowGrainline(FollowGrainline state); FollowGrainline SetFollowGrainline(); @@ -151,22 +151,22 @@ public: * @brief GetPiecesGap returns the pieces gap in Unit::Px * @return */ - qreal GetPiecesGap(); + qreal GetPiecesGap() const; /** * @brief GetPiecesGapConverted returns the pieces gap in the layout's unit * @return */ - qreal GetPiecesGapConverted(); + qreal GetPiecesGapConverted() const; void SetWarningSuperpositionOfPieces(bool state); - bool GetWarningSuperpositionOfPieces(); + bool GetWarningSuperpositionOfPieces() const; void SetWarningPiecesOutOfBound(bool state); - bool GetWarningPiecesOutOfBound(); + bool GetWarningPiecesOutOfBound() const; void SetStickyEdges(bool state); - bool GetStickyEdges(); + bool GetStickyEdges() const; private: Q_DISABLE_COPY(VPuzzleLayout)