10#ifndef SUPPORTED_PROTOCOLS_MODEL_H
11#define SUPPORTED_PROTOCOLS_MODEL_H
19#include <QSortFilterProxyModel>
57 QString
name()
const {
return name_; }
69 QString
filter()
const {
return filter_; }
131 QModelIndex
index(
int row,
int column,
132 const QModelIndex &
parent = QModelIndex())
const;
139 QModelIndex
parent(
const QModelIndex &
index)
const;
147 QVariant data(
const QModelIndex &
index,
int role)
const;
156 QVariant
headerData(
int section, Qt::Orientation orientation,
157 int role = Qt::DisplayRole)
const;
205 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const;
221 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const;
Base class to inherit basic tree item from.
Definition tree_model_helpers.h:25
Tree item representing a single protocol or protocol field in the Supported Protocols tree,...
Definition supported_protocols_model.h:27
protocol_t * protocol() const
Returns the protocol descriptor associated with this item.
Definition supported_protocols_model.h:51
QString description() const
Returns the human-readable description of this protocol or field.
Definition supported_protocols_model.h:75
virtual ~SupportedProtocolsItem()
Destroys the item and all of its child items.
Definition supported_protocols_model.cpp:29
QString name() const
Returns the display name of the protocol or field.
Definition supported_protocols_model.h:57
ftenum_t type() const
Returns the field type of this item.
Definition supported_protocols_model.h:63
QString filter() const
Returns the filter expression string for this protocol or field.
Definition supported_protocols_model.h:69
Tree model that exposes all registered Wireshark protocols and their fields, organised as a parent–ch...
Definition supported_protocols_model.h:92
QModelIndex parent(const QModelIndex &index) const
Returns the parent index of the item at index.
Definition supported_protocols_model.cpp:88
SupportedProtocolsColumn
Column indices for the supported-protocols tree view.
Definition supported_protocols_model.h:110
@ colType
Definition supported_protocols_model.h:113
@ colDescription
Definition supported_protocols_model.h:114
@ colFilter
Definition supported_protocols_model.h:112
@ colLast
Definition supported_protocols_model.h:115
@ colName
Definition supported_protocols_model.h:111
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns column header labels for the supported-protocols table.
Definition supported_protocols_model.cpp:68
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns in the model.
Definition supported_protocols_model.cpp:63
int fieldCount()
Returns the total number of protocol fields loaded by populate().
Definition supported_protocols_model.h:122
void populate()
Populates the model by iterating all registered protocols and their fields; must be called before the...
Definition supported_protocols_model.cpp:157
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Returns the model index for the item at row and column under parent.
Definition supported_protocols_model.cpp:107
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of child rows under parent.
Definition supported_protocols_model.cpp:46
virtual ~SupportedProtocolsModel()
Destroys the model and all tree items.
Definition supported_protocols_model.cpp:41
Sort/filter proxy model for SupportedProtocolsModel that performs case-insensitive substring filterin...
Definition supported_protocols_model.h:191
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
Determines whether the source row should be visible given the current filter.
Definition supported_protocols_model.cpp:230
void setFilter(const QString &filter)
Sets the text filter used to match protocols and fields. An empty string shows all items.
Definition supported_protocols_model.cpp:258
bool filterAcceptItem(SupportedProtocolsItem &item) const
Tests whether a single SupportedProtocolsItem matches the current filter.
Definition supported_protocols_model.cpp:212
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
Compares two source rows for sorting using the active sort column.
Definition supported_protocols_model.cpp:197
enum ftenum ftenum_t
Convenience typedef for ftenum.
Definition ftypes.h:190