mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cleanup: Optimise String Handling.
Cleanup of the sub-optimal string handling in #4222. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
f65afaf5d2
commit
c5546fb52f
1 changed files with 3 additions and 3 deletions
|
@ -333,7 +333,7 @@ void DiveHeartrateItem::createTextItem(int sec, int hr, bool last)
|
|||
int flags = last ? Qt::AlignLeft | Qt::AlignBottom :
|
||||
Qt::AlignRight | Qt::AlignBottom;
|
||||
auto text = std::make_unique<DiveTextItem>(dpr, 0.7, flags, this);
|
||||
text->set(QString("%1").arg(hr), getColor(HR_TEXT));
|
||||
text->set(QStringLiteral("%1").arg(hr), getColor(HR_TEXT));
|
||||
text->setPos(QPointF(hAxis.posAtValue(sec), vAxis.posAtValue(hr)));
|
||||
texts.push_back(std::move(text));
|
||||
}
|
||||
|
@ -641,7 +641,7 @@ void DiveGasPressureItem::replot(const dive *d, int fromIn, int toIn, bool in_pl
|
|||
double DiveGasPressureItem::plotPressureValue(double mbar, double sec, QFlags<Qt::AlignmentFlag> align, double y_offset)
|
||||
{
|
||||
const char *unit;
|
||||
auto label = QString("%1%2").arg(get_pressure_units(lrint(mbar), &unit)).arg(unit);
|
||||
auto label = QStringLiteral("%1%2").arg(get_pressure_units(lrint(mbar), &unit)).arg(unit);
|
||||
auto text = std::make_unique<DiveTextItem>(dpr, 1.0, align, this);
|
||||
text->set(label, getColor(PRESSURE_TEXT));
|
||||
text->setPos(hAxis.posAtValue(sec), vAxis.posAtValue(mbar) + y_offset);
|
||||
|
@ -655,7 +655,7 @@ void DiveGasPressureItem::plotGasValue(double mbar, double sec, const cylinder_t
|
|||
QString gas = get_gas_string(cylinder->gasmix);
|
||||
QString label;
|
||||
if (showDescription)
|
||||
label = QString("(%1) %2").arg(cylinder->type.description).arg(gas);
|
||||
label = QStringLiteral("(%1) %2").arg(cylinder->type.description, gas);
|
||||
else
|
||||
label = gas;
|
||||
auto text = std::make_unique<DiveTextItem>(dpr, 1.0, align, this);
|
||||
|
|
Loading…
Add table
Reference in a new issue