Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
display_filter_edit.h
Go to the documentation of this file.
1
10#ifndef DISPLAYFILTEREDIT_H
11#define DISPLAYFILTEREDIT_H
12
13#include <QDrag>
14#include <QActionGroup>
15#include <QPointer>
16
18
19class QEvent;
21
31
36{
37 Q_OBJECT
38public:
44 explicit DisplayFilterEdit(QWidget *parent = 0, DisplayFilterEditType type = DisplayFilterToEnter);
45
51
52protected:
57 void paintEvent(QPaintEvent *evt);
58
62 void resizeEvent(QResizeEvent *);
63
69
75
80 void focusOutEvent(QFocusEvent *event);
81
86 virtual void dragEnterEvent(QDragEnterEvent *event);
87
92 virtual void dragMoveEvent(QDragMoveEvent *event);
93
98 virtual void dropEvent(QDropEvent *event);
99
104 virtual void contextMenuEvent(QContextMenuEvent *menu);
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);
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<StockIconToolButton> bookmark_button_;
211
213 QPointer<StockIconToolButton> clear_button_;
214
216 QPointer<StockIconToolButton> 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);
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
A line edit widget specialized for entering, validating, and managing display filters.
Definition display_filter_edit.h:36
virtual void dropEvent(QDropEvent *event)
Handles drop events containing filter data.
Definition display_filter_edit.cpp:831
virtual void contextMenuEvent(QContextMenuEvent *menu)
Handles context menu events to display appropriate actions.
Definition display_filter_edit.cpp:160
void setType(DisplayFilterEditType type)
Sets the type of the display filter edit widget.
Definition display_filter_edit.cpp:97
void showPreferencesDialog(QString pane_name)
Signal emitted to request displaying the preferences dialog.
void paintEvent(QPaintEvent *evt)
Handles paint events for the widget.
Definition display_filter_edit.cpp:293
virtual void dragEnterEvent(QDragEnterEvent *event)
Handles drag enter events to accept valid drops.
Definition display_filter_edit.cpp:793
void updateBookmarkMenu()
Updates the bookmark menu with current saved filters.
Definition display_filter_edit.cpp:456
bool checkFilter()
Validates the syntax of the current display filter.
Definition display_filter_edit.cpp:359
void setStyleSheet(const QString &style_sheet)
Sets the widget's style sheet.
Definition display_filter_edit.cpp:643
void popFilterSyntaxStatus()
Signal emitted to pop (remove) the last filter syntax status message.
void resizeEvent(QResizeEvent *)
Handles resize events for the widget.
Definition display_filter_edit.cpp:345
void applyDisplayFilter()
Applies the currently entered display filter.
Definition display_filter_edit.cpp:659
void filterPackets(QString new_filter, bool force)
Signal emitted to request packet filtering with a new filter string.
void keyPressEvent(QKeyEvent *event)
Handles key press events and forwards them to the completion logic.
Definition display_filter_edit.h:68
void focusInEvent(QFocusEvent *event)
Handles focus in events and forwards them to the completion logic.
Definition display_filter_edit.h:74
void focusOutEvent(QFocusEvent *event)
Handles focus out events for the widget.
Definition display_filter_edit.cpp:350
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:713
virtual void dragMoveEvent(QDragMoveEvent *event)
Handles drag move events for visual feedback.
Definition display_filter_edit.cpp:812
A tool button that displays a stock icon.
Definition stock_icon_tool_button.h:19
QLineEdit subclass that adds syntax-state colouring, error messaging, and partial token-based autocom...
Definition syntax_line_edit.h:28
virtual bool event(QEvent *event)
Intercepts Tab and other keys to trigger or dismiss the completer.
Definition syntax_line_edit.cpp:295
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:333
void completionFocusInEvent(QFocusEvent *event)
Triggers a completion refresh when the widget gains focus.
Definition syntax_line_edit.cpp:381
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