MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / replaceUnit

Method replaceUnit

qcustomplot/qcustomplot.cpp:6388–6395  ·  view source on GitHub ↗

! \internal Replaces all occurrences of the format pattern belonging to \a unit in \a text with the specified \a value, using the field width as specified with \ref setFieldWidth for the \a unit. */

Source from the content-addressed store, hash-verified

6386 \a value, using the field width as specified with \ref setFieldWidth for the \a unit.
6387*/
6388void QCPAxisTickerTime::replaceUnit(QString &text, QCPAxisTickerTime::TimeUnit unit, int value) const
6389{
6390 QString valueStr = QString::number(value);
6391 while (valueStr.size() < mFieldWidth.value(unit))
6392 valueStr.prepend(QLatin1Char('0'));
6393
6394 text.replace(mFormatPattern.value(unit), valueStr);
6395}
6396/* end of 'src/axis/axistickertime.cpp' */
6397
6398

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected