Switch some dirty hacking to using real infrastructure. A Chatline now contains three...
[quassel.git] / src / qtui / chatline.cpp
index e0f6d6a..1abfcfb 100644 (file)
 #include "chatline.h"
 #include "qtui.h"
 
 #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();
 }
 
   return childrenBoundingRect();
 }
 
-void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+void Chatline::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
 
 }
 
 
 }