1 #ifndef INFOITEM_H 2 #define INFOITEM_H 3 4 #include <QGraphicsItem> 5 #include <QList> 6 #include "common/kv.h" 7 8 class InfoItem : public QGraphicsItem 9 { 10 public: 11 InfoItem(QGraphicsItem *parent = 0); 12 boundingRect()13 QRectF boundingRect() const {return _boundingRect;} 14 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 15 QWidget *widget); 16 info()17 const QList<KV<QString, QString> > &info() const {return _list;} 18 19 void insert(const QString &key, const QString &value); 20 void clear(); isEmpty()21 bool isEmpty() {return _list.isEmpty();} 22 23 private: 24 void updateBoundingRect(); 25 26 QList<KV<QString, QString> > _list; 27 QRectF _boundingRect; 28 QFont _font; 29 }; 30 31 #endif // INFOITEM_H 32