X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.h;h=45365208a7b03c7bc33d4fbc1a3bfd50468f0b87;hp=24947d0a63211e5121f2d150f35c2265b846e557;hb=f8275c3b697f1ee43d93bb4e5e688e87ca0405ce;hpb=6330f7fe3d19113cbf29944a9b6e8b503893d4a9 diff --git a/src/qtui/chatline.h b/src/qtui/chatline.h index 24947d0a..45365208 100644 --- a/src/qtui/chatline.h +++ b/src/qtui/chatline.h @@ -35,13 +35,18 @@ public: const QPointF &senderPos, const QPointF &contentsPos, QGraphicsItem *parent = 0); + virtual ~ChatLine(); + virtual inline QRectF boundingRect () const { return QRectF(0, 0, _width, _height); } - inline int row() { return _row; } + inline QModelIndex index() const { return model()->index(row(), 0); } + inline MsgId msgId() const { return index().data(MessageModel::MsgIdRole).value(); } + 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() ? chatScene()->chatView() : 0; } inline qreal width() const { return _width; } inline qreal height() const { return _height; } @@ -66,6 +71,8 @@ public: void setSelected(bool selected, ChatLineModel::ColumnType minColumn = ChatLineModel::ContentsColumn); void setHighlighted(bool highlighted); + void clearCache(); + protected: virtual bool sceneEvent(QEvent *event); @@ -101,6 +108,7 @@ private: quint8 _selection; // save space, so we put both the col and the flags into one byte ChatItem *_mouseGrabberItem; + ChatItem *_hoverItem; }; #endif