mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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:
parent
1f9abad852
commit
a65280fbae
1 changed files with 13 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue