fixes and improvements
[Sak.git] / sakmessageitem.h
blob32de30631451f68922ab3d295b41beadaae7fd38
1 #ifndef SAKMESSAGEITEM_H_
2 #define SAKMESSAGEITEM_H_
4 #include <QtGui>
6 class SakMessageItem : public QObject, public QGraphicsItem
8 public:
9 SakMessageItem(const QString& message, const QPixmap& p);
10 ~SakMessageItem();
11 //void setPixmap(const QPixmap &p);
12 //QPixmap pixmap();
13 void setGeometry(const QRect&);
14 QRectF boundingRect() const { return m_rect; }
15 void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
16 private:
17 QGraphicsPixmapItem* m_p;
18 QTextDocument* m_t;
19 QPixmap m_cachedPixmap;
20 QRectF m_rect;
23 class SakExitItem : public QObject, public QGraphicsPixmapItem
25 Q_OBJECT;
26 public:
27 SakExitItem(const QPixmap&p) : QGraphicsPixmapItem(p) {}
28 signals:
29 void exit();
30 protected:
31 void mousePressEvent ( QGraphicsSceneMouseEvent * ) {}
32 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *) { emit exit(); };
35 #endif