| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
filter_dialog.h
Go to the documentation of this file.
1
9
10#ifndef FILTER_DIALOG_H
11#define FILTER_DIALOG_H
12
13#include "geometry_state_dialog.h"
14
15#include <ui/qt/models/filter_list_model.h>
16
17#include <QStyledItemDelegate>
18#include <QValidator>
19
20 class QItemSelection;
21 class FilterTreeDelegate;
22
23 namespace Ui {
24 class FilterDialog;
25}
26
30 class FilterDialog : public GeometryStateDialog
31{
32 Q_OBJECT
33
34 public:
38 enum FilterType {
39 CaptureFilter,
40 DisplayFilter,
41 DisplayMacro
42 };
43
50 explicit FilterDialog(QWidget *parent = 0, FilterType filter_type = CaptureFilter, const QString new_filter = QString());
51
55 ~FilterDialog();
56
57 private:
59 Ui::FilterDialog *ui;
60
62 FilterListModel * model_;
63
65 enum FilterType filter_type_;
66
68 FilterTreeDelegate *filter_tree_delegate_;
69
76 void addFilter(QString name, QString filter, bool start_editing = false);
77
78 private slots:
82 void updateWidgets();
83
89 void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
90
94 void on_newToolButton_clicked();
95
99 void on_deleteToolButton_clicked();
100
104 void on_copyToolButton_clicked();
105
109 void on_buttonBox_accepted();
110
114 void on_buttonBox_helpRequested();
115};
116
120 class FilterTreeDelegate : public QStyledItemDelegate
121{
122 Q_OBJECT
123
124 public:
130 FilterTreeDelegate(QObject *parent, FilterDialog::FilterType filter_type);
131
139 virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
140
146 virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override;
147
148 private:
150 FilterDialog::FilterType filter_type_;
151};
152
160 class DialogFilterValidator : public QValidator
161{
162 public:
169 virtual QValidator::State validate(QString & input, int & pos) const override;
170};
171
175 class MacroNameValidator : public QValidator
176{
177 public:
184 virtual QValidator::State validate(QString & input, int & pos) const override;
185};
186
187#endif // FILTER_DIALOG_H
DialogFilterValidator
A validator for filter strings used by the FilterDialog fields.
Definition filter_dialog.h:161
DialogFilterValidator::validate
virtual QValidator::State validate(QString &input, int &pos) const override
Validates the input filter string.
Definition filter_dialog.cpp:294
FilterDialog::~FilterDialog
~FilterDialog()
Destroys the FilterDialog.
Definition filter_dialog.cpp:107
FilterDialog::FilterDialog
FilterDialog(QWidget *parent=0, FilterType filter_type=CaptureFilter, const QString new_filter=QString())
Constructs a new FilterDialog.
Definition filter_dialog.cpp:30
FilterDialog::FilterType
FilterType
Defines the type of filter being managed by the dialog.
Definition filter_dialog.h:38
FilterDialog::DisplayFilter
@ DisplayFilter
Definition filter_dialog.h:40
FilterDialog::DisplayMacro
@ DisplayMacro
Definition filter_dialog.h:41
FilterDialog::CaptureFilter
@ CaptureFilter
Definition filter_dialog.h:39
FilterListModel
A list model for managing capture filters, display filters, and display macros.
Definition filter_list_model.h:25
FilterTreeDelegate
Delegate for editing capture and display filters.
Definition filter_dialog.h:121
FilterTreeDelegate::setEditorData
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override
Sets the data in the editor from the model.
Definition filter_dialog.cpp:283
FilterTreeDelegate::FilterTreeDelegate
FilterTreeDelegate(QObject *parent, FilterDialog::FilterType filter_type)
Constructs a new FilterTreeDelegate.
Definition filter_dialog.cpp:244
FilterTreeDelegate::createEditor
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates the editor widget for a specific item.
Definition filter_dialog.cpp:249
GeometryStateDialog::GeometryStateDialog
GeometryStateDialog(QWidget *parent, Qt::WindowFlags f=Qt::Window)
Constructs a new GeometryStateDialog with the specified parent and window flags.
Definition geometry_state_dialog.h:91
MacroNameValidator
A validator for macro names.
Definition filter_dialog.h:176
MacroNameValidator::validate
virtual QValidator::State validate(QString &input, int &pos) const override
Validates the input macro name.
Definition filter_dialog.cpp:309
filter_list_model.h
geometry_state_dialog.h
input
Definition tvbuff_lz77huff.c:32