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:
Tomaz Canabrava 2014-10-31 17:38:51 -02:00 committed by Dirk Hohndel
parent dc147be153
commit 1a4e69a3bb

View file

@ -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()