Implemented the setData method for BuddyFilter

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 16:23:57 -02:00 committed by Dirk Hohndel
parent 1f9abad852
commit a65280fbae

View file

@ -2390,7 +2390,19 @@ QVariant BuddyFilterModel::data(const QModelIndex &index, int role) const
bool BuddyFilterModel::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()