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