summaryrefslogtreecommitdiffstats
path: root/logic/EnabledItemFilter.h
blob: cb6d4041b5bf87bcfe89e437a22509b381b49790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once
#include <QSortFilterProxyModel>

class EnabledItemFilter : public QSortFilterProxyModel
{
	Q_OBJECT
public:
	EnabledItemFilter(QObject *parent = 0);
	void setActive(bool active);
	
protected:
	bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
	bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
private:
	bool m_active = false;
};