From 0e7149a695148a403edc234e81bc2d46508c50f6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 23 Apr 2020 15:03:14 +0300 Subject: [PATCH] Pass a variable as constant reference. --- src/app/puzzle/vpuzzlelayer.cpp | 2 +- src/app/puzzle/vpuzzlelayer.h | 2 +- src/app/puzzle/vpuzzlelayout.cpp | 8 ++++---- src/app/puzzle/vpuzzlelayout.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/puzzle/vpuzzlelayer.cpp b/src/app/puzzle/vpuzzlelayer.cpp index 174a161a9..67b466279 100644 --- a/src/app/puzzle/vpuzzlelayer.cpp +++ b/src/app/puzzle/vpuzzlelayer.cpp @@ -67,7 +67,7 @@ QString VPuzzleLayer::GetName() const } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayer::SetName(QString name) +void VPuzzleLayer::SetName(const QString &name) { m_name = name; } diff --git a/src/app/puzzle/vpuzzlelayer.h b/src/app/puzzle/vpuzzlelayer.h index c11759d15..01d94c174 100644 --- a/src/app/puzzle/vpuzzlelayer.h +++ b/src/app/puzzle/vpuzzlelayer.h @@ -45,7 +45,7 @@ public: // certain position in the list QString GetName() const; - void SetName(QString name); + void SetName(const QString &name); void SetIsVisible(bool value); bool GetIsVisible() const; diff --git a/src/app/puzzle/vpuzzlelayout.cpp b/src/app/puzzle/vpuzzlelayout.cpp index 4708ba21a..c785c4046 100644 --- a/src/app/puzzle/vpuzzlelayout.cpp +++ b/src/app/puzzle/vpuzzlelayout.cpp @@ -103,13 +103,13 @@ void VPuzzleLayout::SetLayoutSizeConverted(qreal width, qreal height) } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutSize(QSizeF size) +void VPuzzleLayout::SetLayoutSize(const QSizeF &size) { m_size = size; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutSizeConverted(QSizeF size) +void VPuzzleLayout::SetLayoutSizeConverted(const QSizeF &size) { m_size = QSizeF( UnitConvertor(size.width(), m_unit,Unit::Px), @@ -152,13 +152,13 @@ void VPuzzleLayout::SetLayoutMarginsConverted(qreal left, qreal top, qreal right } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutMargins(QMarginsF margins) +void VPuzzleLayout::SetLayoutMargins(const QMarginsF &margins) { m_margins = margins; } //--------------------------------------------------------------------------------------------------------------------- -void VPuzzleLayout::SetLayoutMarginsConverted(QMarginsF margins) +void VPuzzleLayout::SetLayoutMarginsConverted(const QMarginsF &margins) { m_margins = UnitConvertor(margins, m_unit, Unit::Px); } diff --git a/src/app/puzzle/vpuzzlelayout.h b/src/app/puzzle/vpuzzlelayout.h index d20510013..78ae62fab 100644 --- a/src/app/puzzle/vpuzzlelayout.h +++ b/src/app/puzzle/vpuzzlelayout.h @@ -112,13 +112,13 @@ public: * @brief SetLayoutMargins set the margins of the layout, the values have to be in Unit::Px * @param margins */ - void SetLayoutMargins(QMarginsF margins); + void SetLayoutMargins(const QMarginsF &margins); /** * @brief SetLayoutMargins set the margins of the layout, the values have to be in the unit of the layout * @param margins */ - void SetLayoutMarginsConverted(QMarginsF margins); + void SetLayoutMarginsConverted(const QMarginsF &margins); /** * @brief GetLayoutMargins Returns the size in Unit::Px