-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsermonsortfilterproxymodel.h
More file actions
38 lines (27 loc) · 1012 Bytes
/
Copy pathsermonsortfilterproxymodel.h
File metadata and controls
38 lines (27 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef SERMONSORTFILTERPROXYMODEL_H
#define SERMONSORTFILTERPROXYMODEL_H
#include <QSortFilterProxyModel>
#include <QDate>
#include <QHash>
#include <QRegExp>
#include "databasesupport.h"
class SermonSortFilterProxyModel : public QSortFilterProxyModel
{
public:
SermonSortFilterProxyModel();
QDate filterMinimumDate() const { return minDate; }
void setFilterMinimumDate(const QDate &date, bool invalFltr = true);
QDate filterMaximumDate() const { return maxDate; }
void setFilterMaximumDate(const QDate &date, bool invalFltr = true);
QHash<int, QRegExp> multiFilterRegExp() const { return multiFilter; }
void setMultiFilterRegExp(const QHash<int, QRegExp> &filter);
void resetFilters();
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE;
private:
bool dateInRange(const QDate &date) const;
QDate minDate;
QDate maxDate;
QHash<int, QRegExp> multiFilter;
};
#endif // SERMONSORTFILTERPROXYMODEL_H