mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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
|
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
|
bool LocationFilterModel::filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const
|
||||||
|
|
Loading…
Add table
Reference in a new issue