Skip to content

Commit

Permalink
Replace from QString::fromLatin1 to QStringLiteral for string constans
Browse files Browse the repository at this point in the history
  • Loading branch information
KuzemkoA committed May 29, 2024
1 parent c96ca62 commit 0aa99ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Base/UnitsSchemaFemMilliMeterNewton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ QString UnitsSchemaFemMilliMeterNewton::schemaTranslate(const Quantity& quant,
Unit unit = quant.getUnit();
if (unit == Unit::Length) {
// all length units in millimeters
unitString = QString::fromLatin1("mm");
unitString = QStringLiteral("mm");
factor = 1.0;
}
else if (unit == Unit::Mass) {
// all mass units in t
unitString = QString::fromUtf8("t");
unitString = QStringLiteral("t");
factor = 1e3;

Check warning on line 51 in src/Base/UnitsSchemaFemMilliMeterNewton.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

1e3 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
}
else {
Expand Down

0 comments on commit 0aa99ba

Please sign in to comment.