1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/GUI/powergraphitem.cpp

24 lines
497 B
C++
Raw Normal View History

#include <QLocale>
#include "tooltip.h"
#include "powergraphitem.h"
2017-10-04 23:15:39 +02:00
PowerGraphItem::PowerGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
setToolTip(toolTip());
}
QString PowerGraphItem::toolTip() const
{
ToolTip tt;
QLocale l(QLocale::system());
tt.insert(tr("Maximum"), l.toString(max(), 'f', 1)
2018-09-09 15:26:45 +02:00
+ UNIT_SPACE + tr("W"));
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
2018-09-09 15:26:45 +02:00
+ UNIT_SPACE + tr("W"));
return tt.toString();
}