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);
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);