X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=1abfcfb2eb8b39dc227ef0e9fd4cd011ff31f2bb;hp=e0f6d6a9f9d523f26d97550e9e1fa9143f3b6007;hb=0b9f74984780aacbe85ca04c44ec6304c86557c2;hpb=dd90a17f0cbafb646e1916d9b8a1f048331f3111;ds=sidebyside diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index e0f6d6a9..1abfcfb2 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -27,19 +27,24 @@ #include "chatline.h" #include "qtui.h" -ChatLine::ChatLine(const QPersistentModelIndex &index_, QGraphicsItem *parent) : QGraphicsItem(parent), _index(index_) { +Chatline::Chatline(const QModelIndex &index, QGraphicsItem *parent) : QGraphicsItem(parent) { + _timestampItem = new ChatItem(QPersistentModelIndex(index.sibling(index.row(), ChatlineModel::TimestampColumn)), this); + _senderItem = new ChatItem(QPersistentModelIndex(index.sibling(index.row(), ChatlineModel::SenderColumn)), this); + _contentsItem = new ChatItem(QPersistentModelIndex(index.sibling(index.row(), ChatlineModel::ContentsColumn)), this); + _senderItem->setPos(80, 0); + _contentsItem->setPos(160, 0); } -ChatLine::~ChatLine() { +Chatline::~Chatline() { } -QRectF ChatLine::boundingRect () const { +QRectF Chatline::boundingRect () const { return childrenBoundingRect(); } -void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { +void Chatline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { }