+protected:
+ virtual bool sceneEvent(QEvent *event);
+
+ // These need to be relayed to the appropriate ChatItem
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
+ virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
+ virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
+
+ ChatItem *mouseEventTargetItem(const QPointF &pos);
+
+ inline ChatItem *mouseGrabberItem() const { return _mouseGrabberItem; }
+ void setMouseGrabberItem(ChatItem *item);
+
+private:
+ int _row;
+ QAbstractItemModel *_model;
+ ContentsChatItem _contentsItem;
+ SenderChatItem _senderItem;
+ TimestampChatItem _timestampItem;
+ qreal _width, _height;
+
+ enum { ItemMask = 0x3f,
+ Selected = 0x40,
+ Highlighted = 0x80 };
+ // _selection[1..0] ... Min Selected Column (See MessageModel::ColumnType)
+ // _selection[5..2] ... reserved for new column types
+ // _selection[6] ...... Selected
+ // _selection[7] ...... Highlighted
+ quint8 _selection; // save space, so we put both the col and the flags into one byte
+
+ ChatItem *_mouseGrabberItem;
+ ChatItem *_hoverItem;