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