+ChatLine::ChatLine(int row, QAbstractItemModel *model,
+ const qreal &width,
+ const qreal ×tampWidth, const qreal &senderWidth, const qreal &contentsWidth,
+ const QPointF &senderPos, const QPointF &contentsPos,
+ QGraphicsItem *parent)
+ : QGraphicsItem(parent),
+ _row(row), // needs to be set before the items
+ _model(model),
+ _contentsItem(contentsWidth, contentsPos, this),
+ _senderItem(senderWidth, _contentsItem.height(), senderPos, this),
+ _timestampItem(timestampWidth, _contentsItem.height(), this),
+ _width(width),
+ _height(_contentsItem.height()),
+ _selection(0)
+{
+ Q_ASSERT(model);
+ QModelIndex index = model->index(row, ChatLineModel::ContentsColumn);
+ setHighlighted(model->data(index, MessageModel::FlagsRole).toInt() & Message::Highlight);
+}