2018-09-09 18:46:43 +02:00
|
|
|
#include <QLocale>
|
2017-09-24 19:54:13 +02:00
|
|
|
#include "tooltip.h"
|
|
|
|
#include "cadencegraphitem.h"
|
|
|
|
|
2018-09-09 18:46:43 +02:00
|
|
|
|
2017-10-04 23:15:39 +02:00
|
|
|
CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
|
|
|
|
QGraphicsItem *parent) : GraphItem(graph, type, parent)
|
2017-09-24 19:54:13 +02:00
|
|
|
{
|
|
|
|
setToolTip(toolTip());
|
|
|
|
}
|
|
|
|
|
|
|
|
QString CadenceGraphItem::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:27:44 +02:00
|
|
|
+ UNIT_SPACE + tr("rpm"));
|
2018-09-09 18:46:43 +02:00
|
|
|
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
|
2018-09-09 15:27:44 +02:00
|
|
|
+ UNIT_SPACE + tr("rpm"));
|
2017-09-24 19:54:13 +02:00
|
|
|
|
|
|
|
return tt.toString();
|
|
|
|
}
|