mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
setData method for LocationFilter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
dc147be153
commit
1a4e69a3bb
1 changed files with 13 additions and 1 deletions
|
@ -2503,7 +2503,19 @@ void LocationFilterModel::repopulate()
|
||||||
|
|
||||||
bool LocationFilterModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
bool LocationFilterModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||||
{
|
{
|
||||||
return QStringListModel::setData(index, value, role);
|
if (role == Qt::CheckStateRole) {
|
||||||
|
checkState[index.row()] = value.toBool();
|
||||||
|
anyChecked = false;
|
||||||
|
for (int i = 0; i < rowCount(); i++) {
|
||||||
|
if (checkState[i] == true) {
|
||||||
|
anyChecked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataChanged(index, index);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiFilterSortModel *MultiFilterSortModel::instance()
|
MultiFilterSortModel *MultiFilterSortModel::instance()
|
||||||
|
|
Loading…
Add table
Reference in a new issue