diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-10-31 16:23:57 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-31 14:58:55 -0700 |
commit | a65280fbaef675c9451d4ee961b2c3771d3bbbd2 (patch) | |
tree | c36318f80145c6edca1a4883b4bc406435a3620b /qt-ui/models.cpp | |
parent | 1f9abad8529691ab86e8f4a5027aa6f679ba622c (diff) | |
download | subsurface-a65280fbaef675c9451d4ee961b2c3771d3bbbd2.tar.gz |
Implemented the setData method for BuddyFilter
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.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index faf22de51..81e17edc2 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -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() |