Implemented the 'data' method of LocationFilter.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-10-31 17:32:47 -02:00 committed by Dirk Hohndel
parent 894e0bc7a9
commit 1c0da67a26

View file

@ -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