X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline.h;h=c7ac49b7c6d69acfe3e4b12c3e968b3c491845e2;hb=568045799b7f6e746381b4b3d34a2f47b5433e82;hp=c16de8057b877a1d0adac4d57fbb5fd226c1e671;hpb=f3fc0324c8860dff6af722dafbeb05fcb69a0c41;p=quassel.git diff --git a/src/qtui/chatline.h b/src/qtui/chatline.h index c16de805..c7ac49b7 100644 --- a/src/qtui/chatline.h +++ b/src/qtui/chatline.h @@ -21,14 +21,36 @@ #ifndef CHATLINE_H_ #define CHATLINE_H_ -class Chatline : public MessageItem { +#include + +#include "messagemodel.h" + +class ChatItem; + +class ChatLine : public QGraphicsItem { public: - Chatline(const Message &); + ChatLine(const QModelIndex &tempIndex, QGraphicsItem *parent = 0); + virtual ~ChatLine(); + + virtual QRectF boundingRect () const; + inline int width() const { return _width; } + inline int height() const { return _height; } + + virtual void paint (QPainter * painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); + //void layout(); + + // returns height + qreal setGeometry(qreal width, qreal firstColPos, qreal secondColPos); + + //void myMousePressEvent ( QGraphicsSceneMouseEvent * event ) { qDebug() << "press"; mousePressEvent(event); } - virtual QVariant data(int column, int role) const; - virtual bool setData(int column, const QVariant &value, int role); + protected: + //bool sceneEvent ( QEvent * event ); + private: + ChatItem *_timestampItem, *_senderItem, *_contentsItem; + int _width, _height; }; #endif