From 1a4e69a3bba6c50d6b92f47cf673e7ccc2b770e9 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 31 Oct 2014 17:38:51 -0200 Subject: [PATCH] setData method for LocationFilter. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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()