]> git.cworth.org Git - apitrace/blob - gui/apitracefilter.h
Allow setting of the filter options.
[apitrace] / gui / apitracefilter.h
1 #ifndef APITRACEFILTER_H
2 #define APITRACEFILTER_H
3
4 #include <QSortFilterProxyModel>
5
6 class ApiTraceFilter : public QSortFilterProxyModel
7 {
8     Q_OBJECT
9 public:
10     enum FilterOption {
11         NullFilter        =  0,
12         ExtensionsFilter  = 1 << 0,
13         ResolutionsFilter = 1 << 1,
14         ErrorsQueryFilter = 1 << 2,
15         ExtraStateFilter  = 1 << 3,
16     };
17     Q_DECLARE_FLAGS(FilterOptions, FilterOption)
18 public:
19     ApiTraceFilter(QObject *parent = 0);
20
21     FilterOptions filterOptions() const;
22     void setFilterOptions(FilterOptions opts);
23
24     void setFilterString(const QString &text);
25 protected:
26     bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
27
28 private:
29     QString m_text;
30     FilterOptions m_filters;
31 };
32
33 #endif