summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-10-31 16:23:20 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-31 14:58:55 -0700
commit1f9abad8529691ab86e8f4a5027aa6f679ba622c (patch)
tree321a71bebdabafebd698ee30ad5d1b0da56ff00f /qt-ui/models.cpp
parent7c4ddcbf7ac0fd587f31f22bcefba7ab2f488cb0 (diff)
downloadsubsurface-1f9abad8529691ab86e8f4a5027aa6f679ba622c.tar.gz
Impelmented the Data 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.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 4972fbf00..faf22de51 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2379,7 +2379,12 @@ void BuddyFilterModel::repopulate()
QVariant BuddyFilterModel::data(const QModelIndex &index, int role) const
{
- return QStringListModel::data(index, role);
+ if (role == Qt::CheckStateRole) {
+ return checkState[index.row()] ? Qt::Checked : Qt::Unchecked;
+ } else if (role == Qt::DisplayRole) {
+ return stringList()[index.row()];
+ }
+ return QVariant();
}