X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=72099e672202b3bf03f1cf7476d31e7a9e7366f1;hb=69617bf3e612562feda908587c5fec2c50b77aaf;hp=d4255556f8c7805f72feb511c8424f90dc7916e5;hpb=da2b5b2e4e2b0ea1847a0a5f0cb4a3752fc655c9;p=quassel.git diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index d4255556..72099e67 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -27,7 +27,7 @@ #include "chatscene.h" #include "quasselui.h" -ChatScene::ChatScene(MessageModel *model, QObject *parent) : QGraphicsScene(parent), _model(model) { +ChatScene::ChatScene(QAbstractItemModel *model, QObject *parent) : QGraphicsScene(parent), _model(model) { _width = 0; _timestampWidth = 60; _senderWidth = 80; @@ -37,6 +37,7 @@ ChatScene::ChatScene(MessageModel *model, QObject *parent) : QGraphicsScene(pare _lines.append(line); addItem(line); } + emit heightChanged(height()); } ChatScene::~ChatScene() { @@ -67,6 +68,7 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) { _lines.value(i)->moveBy(0, h); } setSceneRect(QRectF(0, 0, _width, _height)); + emit heightChanged(height()); } } @@ -77,7 +79,8 @@ void ChatScene::setWidth(int w) { line->setPos(0, _height); _height += line->setColumnWidths(_timestampWidth, _senderWidth, w - _timestampWidth - _senderWidth); } - setSceneRect(QRectF(0, 0, _width, _height)); + setSceneRect(QRectF(0, 0, w, _height)); + emit heightChanged(height()); } void ChatScene::mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent ) {