mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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:
parent
894e0bc7a9
commit
1c0da67a26
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue