Use the canonical file name also for the "already open" check
[GPXSee.git] / src / GUI / markerinfoitem.h
blob52052cdc1cfd0eef7874e42e51d7b47fb699d17c
1 #ifndef MARKERINFOITEM_H
2 #define MARKERINFOITEM_H
4 #include <QGraphicsItem>
5 #include <QFont>
6 #include "format.h"
8 class Coordinates;
10 class MarkerInfoItem : public QGraphicsItem
12 public:
13 enum Type {
14 None,
15 Date,
16 Position
19 MarkerInfoItem(QGraphicsItem *parent = 0);
21 QRectF boundingRect() const {return _boundingRect;}
22 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
23 QWidget *widget);
25 void setDate(const QDateTime &date);
26 void setCoordinates(const Coordinates &c);
28 void setColor(const QColor &color);
29 void setBackgroundColor(const QColor &color);
30 void drawBackground(bool draw);
32 static void setCoordinatesFormat(const CoordinatesFormat &format)
33 {_format = format;}
35 private:
36 void updateBoundingRect();
38 QString _s1, _s2;
39 QRectF _boundingRect;
40 QColor _color, _bgColor;
41 QFont _font;
42 bool _drawBackground;
44 static CoordinatesFormat _format;
47 #endif // MARKERINFOITEM_H