1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-07 07:13:21 +02:00
GPXSee/src/infoitem.h
2016-02-02 20:12:56 +01:00

38 lines
695 B
C++

#ifndef INFOITEM_H
#define INFOITEM_H
#include <QGraphicsItem>
#include <QList>
class InfoItem : public QGraphicsItem
{
public:
InfoItem(QGraphicsItem *parent = 0);
QRectF boundingRect() const {return _boundingRect;}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void insert(const QString &key, const QString &value);
void clear();
private:
void updateBoundingRect();
class KV {
public:
QString key;
QString value;
KV(const QString &k, const QString &v)
{key = k; value = v;}
bool operator==(const KV &other) const
{return this->key == other.key;}
};
QList<KV> _list;
QRectF _boundingRect;
};
#endif // INFOITEM_H