+ virtual void paint (QPainter * painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
+ // setColumns and setGeometryByWidth both return height
+ qreal setColumns(const qreal ×tampWidth, const qreal &senderWidth, const qreal &contentsWidth,
+ const QPointF &senderPos, const QPointF &contentsPos);
+ qreal setGeometryByWidth(const qreal &width, const qreal &contentsWidth);
+
+ void setSelected(bool selected, ChatLineModel::ColumnType minColumn = ChatLineModel::ContentsColumn);
+ void setHighlighted(bool highlighted);
+
+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