| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
expert_info_proxy_model.h
Go to the documentation of this file.
1
11
12#ifndef EXPERT_INFO_PROXY_MODEL_H
13#define EXPERT_INFO_PROXY_MODEL_H
14
15#include <config.h>
16
17#include <QSortFilterProxyModel>
18
19 class ExpertPacketItem;
20
24 class ExpertInfoProxyModel : public QSortFilterProxyModel
25{
26 Q_OBJECT
27
28 public:
33 ExpertInfoProxyModel(QObject *parent = 0);
34
38 enum SeverityMode {
39 Group,
40 Packet
41 };
42
46 enum ExpertProxyColumn {
47 colProxySeverity = 0,
48 colProxySummary,
49 colProxyGroup,
50 colProxyProtocol,
51 colProxyCount,
52 colProxyLast
53 };
54
61 QVariant data(const QModelIndex &index, int role) const override;
62
70 QVariant headerData(int section, Qt::Orientation orientation,
71 int role = Qt::DisplayRole) const override;
72
78 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
79
85 bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
86
93 virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
94
95 //GUI helpers
96
101 void setSeverityMode(enum SeverityMode mode);
102
108 void setSeverityFilter(int severity, bool hide);
109
114 void setSummaryFilter(const QString &filter);
115
116 protected:
123 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
124
130 bool filterAcceptItem(ExpertPacketItem& item) const;
131
133 enum SeverityMode severityMode_;
134
136 QList<int> hidden_severities_;
137
139 QString textFilter_;
140
141};
142
143#endif // EXPERT_INFO_PROXY_MODEL_H
ExpertInfoProxyModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Retrieves the header data for a specific section and role.
Definition expert_info_proxy_model.cpp:207
ExpertInfoProxyModel::hidden_severities_
QList< int > hidden_severities_
Definition expert_info_proxy_model.h:136
ExpertInfoProxyModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns under a given parent.
Definition expert_info_proxy_model.cpp:232
ExpertInfoProxyModel::textFilter_
QString textFilter_
Definition expert_info_proxy_model.h:139
ExpertInfoProxyModel::setSummaryFilter
void setSummaryFilter(const QString &filter)
Sets the text filter used to filter items by their summary.
Definition expert_info_proxy_model.cpp:327
ExpertInfoProxyModel::filterAcceptItem
bool filterAcceptItem(ExpertPacketItem &item) const
Checks if an individual expert packet item matches the current filter criteria.
Definition expert_info_proxy_model.cpp:263
ExpertInfoProxyModel::filterAcceptsRow
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Determines whether a row from the source model should be displayed.
Definition expert_info_proxy_model.cpp:289
ExpertInfoProxyModel::data
QVariant data(const QModelIndex &index, int role) const override
Retrieves data from the proxy model for a given index and role.
Definition expert_info_proxy_model.cpp:92
ExpertInfoProxyModel::setSeverityFilter
void setSeverityFilter(int severity, bool hide)
Sets whether a specific severity level should be hidden or shown.
Definition expert_info_proxy_model.cpp:306
ExpertInfoProxyModel::ExpertProxyColumn
ExpertProxyColumn
Enumerates the columns exposed by the proxy model.
Definition expert_info_proxy_model.h:46
ExpertInfoProxyModel::colProxySummary
@ colProxySummary
Definition expert_info_proxy_model.h:48
ExpertInfoProxyModel::colProxyLast
@ colProxyLast
Definition expert_info_proxy_model.h:52
ExpertInfoProxyModel::colProxySeverity
@ colProxySeverity
Definition expert_info_proxy_model.h:47
ExpertInfoProxyModel::colProxyCount
@ colProxyCount
Definition expert_info_proxy_model.h:51
ExpertInfoProxyModel::colProxyProtocol
@ colProxyProtocol
Definition expert_info_proxy_model.h:50
ExpertInfoProxyModel::colProxyGroup
@ colProxyGroup
Definition expert_info_proxy_model.h:49
ExpertInfoProxyModel::hasChildren
bool hasChildren(const QModelIndex &parent=QModelIndex()) const override
Checks if a given parent index has any child elements.
Definition expert_info_proxy_model.cpp:237
ExpertInfoProxyModel::severityMode_
enum SeverityMode severityMode_
Definition expert_info_proxy_model.h:133
ExpertInfoProxyModel::lessThan
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
Compares two source indices to determine their sort order.
Definition expert_info_proxy_model.cpp:23
ExpertInfoProxyModel::SeverityMode
SeverityMode
Defines the mode for displaying and evaluating severities.
Definition expert_info_proxy_model.h:38
ExpertInfoProxyModel::Group
@ Group
Definition expert_info_proxy_model.h:39
ExpertInfoProxyModel::Packet
@ Packet
Definition expert_info_proxy_model.h:40
ExpertInfoProxyModel::ExpertInfoProxyModel
ExpertInfoProxyModel(QObject *parent=0)
Constructs a new ExpertInfoProxyModel.
Definition expert_info_proxy_model.cpp:18
ExpertInfoProxyModel::setSeverityMode
void setSeverityMode(enum SeverityMode mode)
Sets the severity mode for the proxy model.
Definition expert_info_proxy_model.cpp:300
ExpertPacketItem
Represents a single packet or group item in the expert information tree.
Definition expert_info_model.h:31