Core: Propagate dataChanged signal

If the ListModel needs to emit dataChanged signals
ensure they will be handled correctly.

Change-Id: I2a543737ca442819fc4d3dead15108cb3a00765d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-01-22 15:07:31 +01:00
parent 823c44de18
commit f05477dc39

View File

@@ -122,6 +122,14 @@ void GridProxyModel::setSourceModel(QAbstractItemModel *newModel)
beginResetModel(); beginResetModel();
}); });
connect(newModel, &QAbstractItemModel::rowsRemoved, this, [this] { endResetModel(); }); connect(newModel, &QAbstractItemModel::rowsRemoved, this, [this] { endResetModel(); });
connect(newModel,
&QAbstractItemModel::dataChanged,
this,
[this] (const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles) {
QAbstractItemModel::dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight), roles);
});
} }
} }