Use Qt::DisplayRole when the lookup fails

This makes it do the right thing by default, and fixes filtering for
QStringListModels (and probably a few other ones as well).
This commit is contained in:
Sebastian Kügler 2011-10-30 00:50:41 +02:00
parent 6b7a1bdcac
commit 5a4bef41ef

View File

@ -60,7 +60,7 @@ void SortFilterModel::syncRoleNames()
int SortFilterModel::roleNameToId(const QString &name)
{
if (!m_roleIds.contains(name)) {
return -1;
return Qt::DisplayRole;
}
return m_roleIds.value(name);
}