X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=89d4422a6f366d018f8efaf8c08614a96babd5eb;hp=40a0c8b0826c96b67cd0ea6d6e9cace0f19a2d04;hb=0c498574d2f26bae581bc8f9a01e739e1f9c3872;hpb=e88a5b5f44c84f3892c120b98e6a376032a32644 diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index 40a0c8b0..89d4422a 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -96,7 +96,7 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w connect(&webPreview.delayTimer, SIGNAL(timeout()), this, SLOT(showWebPreview())); // installEventFilter(this); - // setItemIndexMethod(QGraphicsScene::NoIndex); + setItemIndexMethod(QGraphicsScene::NoIndex); } ChatScene::~ChatScene() { @@ -192,6 +192,10 @@ void ChatScene::rowsInserted(const QModelIndex &index, int start, int end) { } } + // check if all went right + Q_ASSERT(start == 0 || _lines.at(start - 1)->pos().y() + _lines.at(start - 1)->height() == _lines.at(start)->pos().y()); + Q_ASSERT(end + 1 == _lines.count() || _lines.at(end)->pos().y() + _lines.at(end)->height() == _lines.at(end + 1)->pos().y()); + if(!atBottom) { if(start < _firstLineRow) { int prevFirstLineRow = _firstLineRow + (end - start + 1);