summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-10-31 17:38:51 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-31 14:58:56 -0700
commit1a4e69a3bba6c50d6b92f47cf673e7ccc2b770e9 (patch)
tree5c06066ea71753c8d77589009422fb8570cf8cfd /qt-ui/models.cpp
parentdc147be1536e67ea7ff2c3bfd77198a8f3eddb24 (diff)
downloadsubsurface-1a4e69a3bba6c50d6b92f47cf673e7ccc2b770e9.tar.gz
setData method for LocationFilter.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 47fc4dd66..88c2c4331 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2503,7 +2503,19 @@ void LocationFilterModel::repopulate()
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()