Emit which role actually changed

Change-Id: I596a81628e5553779986a94769e114d89a44b264
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Albert Astals Cid 2013-02-20 12:18:40 +01:00 committed by The Qt Project
parent c816a338f7
commit 20dbad1bbf

View File

@ -189,7 +189,7 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value,
if (index.row() >= 0 && index.row() < lst.size()
&& (role == Qt::EditRole || role == Qt::DisplayRole)) {
lst.replace(index.row(), value.toString());
emit dataChanged(index, index);
emit dataChanged(index, index, QVector<int>() << role);
return true;
}
return false;