1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-05 22:13:59 +01:00
GPXSee/src/GUI/motioninfoitem.h

39 lines
929 B
C++

#ifndef MOTIONINFOITEM_H
#define MOTIONINFOITEM_H
#include <QGraphicsItem>
#include "units.h"
class MotionInfoItem : public QGraphicsItem
{
public:
MotionInfoItem(QGraphicsItem *parent = 0);
QRectF boundingRect() const {return _boundingRect;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void setInfo(qreal bearing, qreal speed, qreal verticalSpeed);
void setUnits(Units units);
void setDigitalZoom(qreal zoom);
void setColor(const QColor &color);
void setBackgroundColor(const QColor &color);
void drawBackground(bool draw);
private:
void updateBoundingRect();
QString speed(const QLocale &l) const;
QString verticalSpeed(const QLocale &l) const;
QString text() const;
qreal _bearing, _speed, _verticalSpeed;
Units _units;
QRectF _boundingRect;
QFont _font;
qreal _digitalZoom;
QColor _color, _bgColor;
bool _drawBackground;
};
#endif // MOTIONINFOITEM_H