mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Martin Tůma
f683525fce
All text items on the map (including path marker info) have now the same background color (the map background color) and the "info background" option also applies to all items now.
48 lines
926 B
C++
48 lines
926 B
C++
#ifndef MARKERINFOITEM_H
|
|
#define MARKERINFOITEM_H
|
|
|
|
#include <QGraphicsItem>
|
|
#include <QFont>
|
|
#include "format.h"
|
|
|
|
class Coordinates;
|
|
|
|
class MarkerInfoItem : public QGraphicsItem
|
|
{
|
|
public:
|
|
enum Type {
|
|
None,
|
|
Date,
|
|
Position
|
|
};
|
|
|
|
MarkerInfoItem(QGraphicsItem *parent = 0);
|
|
|
|
QRectF boundingRect() const {return _boundingRect;}
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
QWidget *widget);
|
|
|
|
void setDate(const QDateTime &date);
|
|
void setCoordinates(const Coordinates &c);
|
|
|
|
void setColor(const QColor &color);
|
|
void setBackgroundColor(const QColor &color);
|
|
void drawBackground(bool draw);
|
|
|
|
static void setCoordinatesFormat(const CoordinatesFormat &format)
|
|
{_format = format;}
|
|
|
|
private:
|
|
void updateBoundingRect();
|
|
|
|
QString _s1, _s2;
|
|
QRectF _boundingRect;
|
|
QColor _color, _bgColor;
|
|
QFont _font;
|
|
bool _drawBackground;
|
|
|
|
static CoordinatesFormat _format;
|
|
};
|
|
|
|
#endif // MARKERINFOITEM_H
|