2021-02-06 15:23:02 +01:00
|
|
|
#ifndef MARKERINFOITEM_H
|
|
|
|
#define MARKERINFOITEM_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
2021-02-12 22:41:38 +01:00
|
|
|
#include "format.h"
|
|
|
|
|
|
|
|
class Coordinates;
|
2021-02-06 15:23:02 +01:00
|
|
|
|
|
|
|
class MarkerInfoItem : public QGraphicsItem
|
|
|
|
{
|
|
|
|
public:
|
2021-02-12 22:41:38 +01:00
|
|
|
enum Type {
|
|
|
|
None,
|
|
|
|
Date,
|
|
|
|
Position
|
|
|
|
};
|
|
|
|
|
2021-02-06 15:23:02 +01:00
|
|
|
MarkerInfoItem(QGraphicsItem *parent = 0);
|
|
|
|
|
|
|
|
QRectF boundingRect() const {return _boundingRect;}
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
|
|
QWidget *widget);
|
|
|
|
|
|
|
|
void setDate(const QDateTime &date);
|
2021-02-12 22:41:38 +01:00
|
|
|
void setCoordinates(const Coordinates &c);
|
|
|
|
|
2021-02-06 15:23:02 +01:00
|
|
|
void setColor(const QColor &color);
|
|
|
|
|
2021-02-12 22:41:38 +01:00
|
|
|
static void setCoordinatesFormat(const CoordinatesFormat &format)
|
|
|
|
{_format = format;}
|
|
|
|
|
2021-02-06 15:23:02 +01:00
|
|
|
private:
|
|
|
|
void updateBoundingRect();
|
|
|
|
|
2021-02-12 22:41:38 +01:00
|
|
|
QString _s1, _s2;
|
2021-02-06 15:23:02 +01:00
|
|
|
QRectF _boundingRect;
|
|
|
|
QColor _color;
|
|
|
|
QFont _font;
|
2021-02-12 22:41:38 +01:00
|
|
|
|
|
|
|
static CoordinatesFormat _format;
|
2021-02-06 15:23:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MARKERINFOITEM_H
|