X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=bcfea000e81ccb4e0d6d2e8aa341111fa4b2616b;hp=e20f3d636464641807aed3692ef021bf65735a96;hb=d7a7c6e5242fd0f500b2c1c75579c9db81a91d0c;hpb=00f633d013c9c9b87ae811c62daca40c1f73d1b8 diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index e20f3d63..bcfea000 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -96,6 +96,7 @@ ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal w this, SLOT(rowsInserted(const QModelIndex &, int, int))); connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int))); + connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(dataChanged(QModelIndex, QModelIndex))); if(model->rowCount() > 0) rowsInserted(QModelIndex(), 0, model->rowCount() - 1); @@ -380,6 +381,13 @@ void ChatScene::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e updateSceneRect(); } +void ChatScene::dataChanged(const QModelIndex &tl, const QModelIndex &br) { + // This should only be sent (currently) if the style is reloaded -> re-layout the whole scene + // TODO: Check range and only do partial relayouts, if appropriate + + layout(); +} + void ChatScene::updateForViewport(qreal width, qreal height) { _viewportHeight = height; setWidth(width);