aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-10-31 17:32:47 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-31 14:58:56 -0700
commit1c0da67a267b9fc6a77608b4e2fa0aead472a393 (patch)
tree3559ba6d6a17e9db50909d0cf5bf378ef94fe6dc /qt-ui/models.cpp
parent894e0bc7a936acac9a07349debe924b9aa979018 (diff)
downloadsubsurface-1c0da67a267b9fc6a77608b4e2fa0aead472a393.tar.gz
Implemented the 'data' method of 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.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index cda5ab5b2..15f3a92ed 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -2472,7 +2472,12 @@ LocationFilterModel::LocationFilterModel(QObject *parent): QStringListModel(pare
QVariant LocationFilterModel::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();
}
bool LocationFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const