Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
display_filter_edit.h
Go to the documentation of this file.
1
9
10#ifndef DISPLAYFILTEREDIT_H
11#define DISPLAYFILTEREDIT_H
12
13#include <QDrag>
14#include <QActionGroup>
15#include <QPointer>
16
18
19class QEvent;
20class QToolButton;
21
31
36{
37 Q_OBJECT
38public:
44 explicit DisplayFilterEdit(QWidget *parent = 0, DisplayFilterEditType type = DisplayFilterToEnter);
45
51
52protected:
57 void paintEvent(QPaintEvent *evt) override;
58
62 void resizeEvent(QResizeEvent *) override;
63
68 void keyPressEvent(QKeyEvent *event) override { completionKeyPressEvent(event); }
69
74 void focusInEvent(QFocusEvent *event) override { completionFocusInEvent(event); }
75
80 void focusOutEvent(QFocusEvent *event) override;
81
86 virtual void dragEnterEvent(QDragEnterEvent *event) override;
87
92 virtual void dragMoveEvent(QDragMoveEvent *event) override;
93
98 virtual void dropEvent(QDropEvent *event) override;
99
104 virtual void contextMenuEvent(QContextMenuEvent *menu) override;
105
106public slots:
111 bool checkFilter();
112
116 void updateBookmarkMenu();
117
121 void applyDisplayFilter();
122
127 void displayFilterSuccess(bool success);
128
133 void setStyleSheet(const QString &style_sheet);
134
135private slots:
140 void checkFilter(const QString &filter_text);
141
145 void clearFilter();
146
151 void changeEvent(QEvent* event) override;
152
156 void displayFilterExpression();
157
161 void saveFilter();
162
166 void removeFilter();
167
171 void showFilters();
172
176 void showExpressionPrefs();
177
181 void applyOrPrepareFilter();
182
186 void triggerAlignementAction();
187
191 void connectToMainWindow();
192
193private:
196
198 QString placeholder_text_;
199
201 QAction *save_action_;
202
204 QAction *remove_action_;
205
207 QActionGroup * actions_;
208
210 QPointer<QToolButton> bookmark_button_;
211
213 QPointer<QToolButton> clear_button_;
214
216 QPointer<QToolButton> apply_button_;
217
219 bool leftAlignActions_;
220
222 QString last_applied_;
223
225 QString filter_word_preamble_;
226
228 bool autocomplete_accepts_field_;
229
231 QString style_sheet_;
232
236 void setDefaultPlaceholderText();
237
243 void buildCompletionList(const QString &field_word, const QString &preamble) override;
244
251 void createFilterTextDropMenu(QDropEvent *event, bool prepare, QString filterText = QString());
252
256 void alignActionButtons();
257
261 void updateClearButton();
262
263signals:
268 void pushFilterSyntaxStatus(const QString& msg);
269
274
280 void filterPackets(QString new_filter, bool force);
281
286 void showPreferencesDialog(QString pane_name);
287
288};
289
290#endif // DISPLAYFILTEREDIT_H
void setType(DisplayFilterEditType type)
Sets the type of the display filter edit widget.
Definition display_filter_edit.cpp:101
void showPreferencesDialog(QString pane_name)
Signal emitted to request displaying the preferences dialog.
virtual void contextMenuEvent(QContextMenuEvent *menu) override
Handles context menu events to display appropriate actions.
Definition display_filter_edit.cpp:180
void keyPressEvent(QKeyEvent *event) override
Handles key press events and forwards them to the completion logic.
Definition display_filter_edit.h:68
void updateBookmarkMenu()
Updates the bookmark menu with current saved filters.
Definition display_filter_edit.cpp:480
DisplayFilterEdit(QWidget *parent=0, DisplayFilterEditType type=DisplayFilterToEnter)
Constructs a new DisplayFilterEdit widget.
Definition display_filter_edit.cpp:66
virtual void dropEvent(QDropEvent *event) override
Handles drop events containing filter data.
Definition display_filter_edit.cpp:855
bool checkFilter()
Validates the syntax of the current display filter.
Definition display_filter_edit.cpp:383
void setStyleSheet(const QString &style_sheet)
Sets the widget's style sheet.
Definition display_filter_edit.cpp:667
void resizeEvent(QResizeEvent *) override
Handles resize events for the widget.
Definition display_filter_edit.cpp:369
virtual void dragMoveEvent(QDragMoveEvent *event) override
Handles drag move events for visual feedback.
Definition display_filter_edit.cpp:836
void popFilterSyntaxStatus()
Signal emitted to pop (remove) the last filter syntax status message.
void applyDisplayFilter()
Applies the currently entered display filter.
Definition display_filter_edit.cpp:683
void focusOutEvent(QFocusEvent *event) override
Handles focus out events for the widget.
Definition display_filter_edit.cpp:374
virtual void dragEnterEvent(QDragEnterEvent *event) override
Handles drag enter events to accept valid drops.
Definition display_filter_edit.cpp:817
void focusInEvent(QFocusEvent *event) override
Handles focus in events and forwards them to the completion logic.
Definition display_filter_edit.h:74
void filterPackets(QString new_filter, bool force)
Signal emitted to request packet filtering with a new filter string.
void paintEvent(QPaintEvent *evt) override
Handles paint events for the widget.
Definition display_filter_edit.cpp:317
void pushFilterSyntaxStatus(const QString &msg)
Signal emitted to push a status message regarding filter syntax.
void displayFilterSuccess(bool success)
Updates the UI state indicating whether the display filter was successfully applied.
Definition display_filter_edit.cpp:737
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
DisplayFilterEditType
Specifies how a filter or column expression entered in the filter edit widget should be handled.
Definition display_filter_edit.h:25
@ ReadFilterToApply
Definition display_filter_edit.h:28
@ CustomColumnToEnter
Definition display_filter_edit.h:29
@ DisplayFilterToApply
Definition display_filter_edit.h:26
@ DisplayFilterToEnter
Definition display_filter_edit.h:27