MCPcopy Create free account
hub / github.com/KDAB/KDChart / customizedLabel

Method customizedLabel

examples/Plotter/Timeline/timeaxis.cpp:21–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21const QString TimeAxis::customizedLabel(const QString &label) const
22{
23 // Here we are free to format the value to whatever we want. As example we
24 // could also return a scientific notation with something like the following
25 // both lines;
26 // const int precision = 2;
27 // return QString::number(label.toReal(), 'E', precision);
28
29 // Format the time-value to a nice string representation.
30 const QDateTime dateTime = QDateTime::fromSecsSinceEpoch(label.toDouble() * 3600.0);
31 return dateTime.date().toString();
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected