From 1c0da67a267b9fc6a77608b4e2fa0aead472a393 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 31 Oct 2014 17:32:47 -0200 Subject: [PATCH] Implemented the 'data' method of LocationFilter. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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