Core: Fix item flag on locator settingspage

Do not make the 'included by default' column editable as this would make
the column act strange on double clicks.
Instead of providing a non-functional change opportunity for the
checkstate's value this is now handled similar to the double click on
other columns.

Change-Id: Id2851b2bfe2b7cda8c3231f58bf436196a533171
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2023-04-27 08:03:48 +02:00
parent 3aec6b776c
commit 927c34df2f

View File

@@ -85,7 +85,7 @@ QVariant FilterItem::data(int column, int role) const
return m_filter->shortcutString();
break;
case FilterIncludedByDefault:
if (role == Qt::CheckStateRole || role == SortRole || role == Qt::EditRole)
if (role == Qt::CheckStateRole || role == SortRole)
return m_filter->isIncludedByDefault() ? Qt::Checked : Qt::Unchecked;
break;
default:
@@ -102,7 +102,7 @@ Qt::ItemFlags FilterItem::flags(int column) const
if (column == FilterPrefix)
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable;
if (column == FilterIncludedByDefault)
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsUserCheckable;
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
}