]> git.cworth.org Git - apitrace/blob - gui/apitracefilter.h
Implement jumping to a specific call.
[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
26     QModelIndex callIndex(int callNum) const;
27 protected:
28     bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
29
30 private:
31     QString m_text;
32     FilterOptions m_filters;
33 };
34
35 #endif