CModelEditorWindow: Reduce string churn

We can just pass by reference.
This commit is contained in:
Lioncache
2025-12-03 17:15:59 -05:00
parent 379fd472ed
commit d75f017522
4 changed files with 14 additions and 14 deletions

View File

@@ -109,10 +109,10 @@ CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent)
connect(ui->EnableDynamicLightingCheck, &QCheckBox::toggled, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
connect(ui->SourceBlendComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
connect(ui->DestBlendComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerA, &WColorPicker::ColorChanged, this, qOverload<QColor>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerB, &WColorPicker::ColorChanged, this, qOverload<QColor>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerC, &WColorPicker::ColorChanged, this, qOverload<QColor>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerD, &WColorPicker::ColorChanged, this, qOverload<QColor>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerA, &WColorPicker::ColorChanged, this, qOverload<const QColor&>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerB, &WColorPicker::ColorChanged, this, qOverload<const QColor&>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerC, &WColorPicker::ColorChanged, this, qOverload<const QColor&>(&CModelEditorWindow::UpdateMaterial));
connect(ui->KonstColorPickerD, &WColorPicker::ColorChanged, this, qOverload<const QColor&>(&CModelEditorWindow::UpdateMaterial));
connect(ui->PassTable, &QTableWidget::cellClicked, this, qOverload<int, int>(&CModelEditorWindow::UpdateMaterial));
connect(ui->TevKColorSelComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
connect(ui->TevKAlphaSelComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
@@ -541,7 +541,7 @@ void CModelEditorWindow::UpdateMaterial(bool Value)
}
}
void CModelEditorWindow::UpdateMaterial(QColor Color)
void CModelEditorWindow::UpdateMaterial(const QColor& Color)
{
// This function takes input from WColorPickers
if (!mpCurrentMat) return;
@@ -568,7 +568,7 @@ void CModelEditorWindow::UpdateMaterial(QColor Color)
}
}
void CModelEditorWindow::UpdateMaterial(QString Value)
void CModelEditorWindow::UpdateMaterial(const QString& Value)
{
// This function takes input from WResourceSelectors
if (!mpCurrentMat) return;

View File

@@ -93,8 +93,8 @@ public slots:
void UpdateMaterial(int ValueA, int ValueB);
void UpdateMaterial(double Value);
void UpdateMaterial(bool Value);
void UpdateMaterial(QColor Value);
void UpdateMaterial(QString Value);
void UpdateMaterial(const QColor& Color);
void UpdateMaterial(const QString& Value);
void UpdateUI(int Value);
void UpdateAnimParamUI(EUVAnimMode Mode);

View File

@@ -85,7 +85,7 @@ QColor WColorPicker::Color() const
return mColor;
}
void WColorPicker::SetColor(QColor Color)
void WColorPicker::SetColor(const QColor& Color)
{
if (mColor != Color)
{
@@ -95,7 +95,7 @@ void WColorPicker::SetColor(QColor Color)
}
}
void WColorPicker::DialogColorChanged(QColor NewColor)
void WColorPicker::DialogColorChanged(const QColor& NewColor)
{
mColor = NewColor;
emit ColorChanged(mColor);

View File

@@ -18,14 +18,14 @@ public:
void mousePressEvent(QMouseEvent*) override;
void mouseReleaseEvent(QMouseEvent* pEvent) override;
QColor Color() const;
void SetColor(QColor Color);
void SetColor(const QColor& Color);
signals:
void ColorChanged(QColor NewColor);
void ColorEditComplete(QColor NewColor);
void ColorChanged(const QColor& NewColor);
void ColorEditComplete(const QColor& NewColor);
private slots:
void DialogColorChanged(QColor NewColor);
void DialogColorChanged(const QColor& NewColor);
void DialogRejected();
};