Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
field_filter_edit.h
Go to the documentation of this file.
1
9
10#ifndef FIELDFILTEREDIT_H
11#define FIELDFILTEREDIT_H
12
14
15class QEvent;
16
21{
22 Q_OBJECT
23public:
28 explicit FieldFilterEdit(QWidget *parent = 0);
29
37 void setFieldListMode(bool enabled);
38
43 void setMaxFields(int max_fields);
44
50 QStringList fieldList() const;
51
57 QString fieldListMessage() const { return list_message_; }
58
59protected:
64 void keyPressEvent(QKeyEvent *event) override { completionKeyPressEvent(event); }
65
70 void focusInEvent(QFocusEvent *event) override { completionFocusInEvent(event); }
71
76 void focusOutEvent(QFocusEvent *event) override;
77
78public slots:
83 bool checkFilter();
84
85private slots:
90 void checkFilter(const QString &filter_text);
91
96 void changeEvent(QEvent* event) override;
97
98private:
100 QString placeholder_text_;
101
103 bool list_mode_ = false;
104
106 int max_fields_ = 0;
107
109 QString list_message_;
110
116 static QStringList splitFieldList(const QString &text);
117
122 void checkFieldList(const QString &filter_text);
123
127 void setDefaultPlaceholderText();
128
134 void buildCompletionList(const QString &field_word, const QString &preamble) override;
135
136signals:
141 void pushFilterSyntaxStatus(const QString& status);
142
147
152 void pushFilterSyntaxWarning(const QString& warning);
153};
154
155#endif // FIELDFILTEREDIT_H
void focusInEvent(QFocusEvent *event) override
Handles focus in events, triggering completion logic if necessary.
Definition field_filter_edit.h:70
void pushFilterSyntaxStatus(const QString &status)
Signal emitted to display a syntax status message.
void pushFilterSyntaxWarning(const QString &warning)
Signal emitted to display a syntax warning message.
FieldFilterEdit(QWidget *parent=0)
Constructs a new FieldFilterEdit.
Definition field_filter_edit.cpp:36
QString fieldListMessage() const
Returns the message of the last list mode check.
Definition field_filter_edit.h:57
bool checkFilter()
Checks the validity of the current filter text.
Definition field_filter_edit.cpp:117
void keyPressEvent(QKeyEvent *event) override
Handles key press events, routing them to completion logic.
Definition field_filter_edit.h:64
QStringList fieldList() const
Returns the entered fields.
Definition field_filter_edit.cpp:77
void popFilterSyntaxStatus()
Signal emitted to remove or pop the current syntax status message.
void focusOutEvent(QFocusEvent *event) override
Handles focus out events.
Definition field_filter_edit.cpp:110
void setMaxFields(int max_fields)
Sets the maximum number of fields accepted in list mode.
Definition field_filter_edit.cpp:58
void setFieldListMode(bool enabled)
Switches between single field mode (default) and list mode.
Definition field_filter_edit.cpp:51
SyntaxLineEdit(QWidget *parent=0)
Constructs the SyntaxLineEdit in the Empty state with no completer.
Definition syntax_line_edit.cpp:38
void completionKeyPressEvent(QKeyEvent *event)
Handles key press events while the completer popup is visible, forwarding navigation keys to the popu...
Definition syntax_line_edit.cpp:337
void completionFocusInEvent(QFocusEvent *event)
Triggers a completion refresh when the widget gains focus.
Definition syntax_line_edit.cpp:385
virtual bool event(QEvent *event) override
Intercepts Tab and other keys to trigger or dismiss the completer.
Definition syntax_line_edit.cpp:300