1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-02 13:59:16 +02:00

Added support for nautical units

This commit is contained in:
2018-02-11 23:51:57 +01:00
parent 27632bf07e
commit 820f967bd6
10 changed files with 100 additions and 41 deletions

View File

@ -16,8 +16,10 @@ SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type,
QString SpeedGraphItem::toolTip() const
{
ToolTip tt;
qreal scale = (_units == Metric) ? MS2KMH : MS2MIH;
QString su = (_units == Metric) ? tr("km/h") : tr("mi/h");
qreal scale = (_units == Imperial) ? MS2MIH : (_units == Nautical)
? MS2KN : MS2KMH;
QString su = (_units == Imperial) ? tr("mi/h") : (_units == Nautical)
? tr("kn") : tr("km/h");
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 1)
+ UNIT_SPACE + su);