Avoid recalculating header view sizes when irrelevant roles change

This commit is contained in:
baldurk
2020-10-16 14:47:50 +01:00
parent c2a21a9106
commit 8d647e5584
+4 -1
View File
@@ -98,7 +98,10 @@ void RDHeaderView::setModel(QAbstractItemModel *model)
QObject::connect(model, &QAbstractItemModel::rowsRemoved, this, &RDHeaderView::rowsChanged);
QObject::connect(model, &QAbstractItemModel::dataChanged,
[this](const QModelIndex &topLeft, const QModelIndex &bottomRight,
const QVector<int> &roles) { rowsChanged(QModelIndex(), 0, 0); });
const QVector<int> &roles) {
if(roles.contains(Qt::DisplayRole))
rowsChanged(QModelIndex(), 0, 0);
});
}
}