blob: 762d9b157a3df2d743cc7418044bbe4342c8ba4d (
plain)
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
|
#ifndef FILTERWIDGET_H
#define FILTERWIDGET_H
class EventFilter;
class FilterWidget
{
public:
std::function<void ()> changed;
FilterWidget();
void set(QLineEdit* edit);
void clear();
bool matches(std::function<bool (const QString& what)> pred) const;
private:
QLineEdit* m_edit;
EventFilter* m_eventFilter;
QToolButton* m_clear;
QString m_text;
QList<QList<QString>> m_compiled;
void unhook();
void createClear();
void hookEvents();
void repositionClearButton();
void onTextChanged();
void onResized();
void compile();
};
#endif // FILTERWIDGET_H
|