forked from qt-creator/qt-creator
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:
@@ -122,6 +122,14 @@ void GridProxyModel::setSourceModel(QAbstractItemModel *newModel)
|
||||
beginResetModel();
|
||||
});
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user