2015-10-12 01:12:12 +02:00
|
|
|
#ifndef INFOITEM_H
|
|
|
|
#define INFOITEM_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
2015-10-13 00:27:49 +02:00
|
|
|
#include <QList>
|
2015-10-12 01:12:12 +02:00
|
|
|
|
|
|
|
class InfoItem : public QGraphicsItem
|
|
|
|
{
|
|
|
|
public:
|
2015-10-17 01:33:02 +02:00
|
|
|
InfoItem(QGraphicsItem *parent = 0);
|
2015-10-12 01:12:12 +02:00
|
|
|
|
|
|
|
QRectF boundingRect() const;
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
|
|
QWidget *widget);
|
|
|
|
|
|
|
|
void insert(const QString &key, const QString &value);
|
2015-10-13 00:27:49 +02:00
|
|
|
void clear() {_list.clear();}
|
2015-10-12 01:12:12 +02:00
|
|
|
|
|
|
|
private:
|
2015-10-13 00:27:49 +02:00
|
|
|
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;
|
2015-10-12 01:12:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INFOITEM_H
|