X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline.h;h=06be6f68907c2074f07bf25a8a6e2e3a78e5e5a4;hb=79a8a98f5a499c2da6c1e57855e9c7b2815ec6d4;hp=a7c68e87d5aacbc7458e2d89fb8e62602ff41612;hpb=57982f5802c957e768ce842888591115694fcbef;p=quassel.git diff --git a/src/qtui/chatline.h b/src/qtui/chatline.h index a7c68e87..06be6f68 100644 --- a/src/qtui/chatline.h +++ b/src/qtui/chatline.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2010 by the Quassel Project * + * Copyright (C) 2005-2012 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -35,16 +35,20 @@ public: const QPointF &senderPos, const QPointF &contentsPos, QGraphicsItem *parent = 0); + virtual ~ChatLine(); + virtual inline QRectF boundingRect () const { return QRectF(0, 0, _width, _height); } inline QModelIndex index() const { return model()->index(row(), 0); } inline MsgId msgId() const { return index().data(MessageModel::MsgIdRole).value(); } + inline Message::Type msgType() const { return (Message::Type)index().data(MessageModel::TypeRole).toInt(); } + inline int row() const { return _row; } inline void setRow(int row) { _row = row; } inline const QAbstractItemModel *model() const { return _model; } inline ChatScene *chatScene() const { return qobject_cast(scene()); } - inline ChatView *chatView() const { return chatScene()->chatView(); } + inline ChatView *chatView() const { return chatScene() ? chatScene()->chatView() : 0; } inline qreal width() const { return _width; } inline qreal height() const { return _height; } @@ -69,6 +73,8 @@ public: void setSelected(bool selected, ChatLineModel::ColumnType minColumn = ChatLineModel::ContentsColumn); void setHighlighted(bool highlighted); + void clearCache(); + protected: virtual bool sceneEvent(QEvent *event);