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:
parent
6b7a1bdcac
commit
5a4bef41ef
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user