Pass a variable as constant reference.

This commit is contained in:
Roman Telezhynskyi 2020-04-23 15:03:14 +03:00
parent ffe8ffa322
commit 0e7149a695
4 changed files with 8 additions and 8 deletions

View File

@ -67,7 +67,7 @@ QString VPuzzleLayer::GetName() const
}
//---------------------------------------------------------------------------------------------------------------------
void VPuzzleLayer::SetName(QString name)
void VPuzzleLayer::SetName(const QString &name)
{
m_name = name;
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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