10#ifndef TRAFFIC_TYPES_LIST_H
11#define TRAFFIC_TYPES_LIST_H
16#include <QAbstractListModel>
20#include <QSortFilterProxyModel>
107 virtual int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
114 virtual int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
122 virtual QVariant data(
const QModelIndex &idx,
int role = Qt::DisplayRole)
const override;
131 virtual QVariant
headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
141 virtual bool setData(
const QModelIndex &idx,
const QVariant &value,
int role)
override;
148 virtual Qt::ItemFlags flags(
const QModelIndex &idx)
const override;
172 QList<TrafficTypesRowData> _allTaps;
197 void setFilter(QString filter = QString());
207 virtual bool lessThan(
const QModelIndex &source_left,
208 const QModelIndex &source_right)
const override;
217 const QModelIndex &source_parent)
const override;
253 QList<int>
protocols(
bool onlySelected =
false)
const;
Sort/filter proxy model for TrafficTypesModel that supports case-insensitive name filtering and proto...
Definition traffic_types_list.h:182
void setFilter(QString filter=QString())
Sets the text filter used to show only protocols whose name contains the given string (case-insensiti...
Definition traffic_types_list.cpp:238
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
Determines whether a source row should be visible given the current filter.
Definition traffic_types_list.cpp:253
virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
Compares two rows for sorting, using protocol name for the name column and numeric ordering for the p...
Definition traffic_types_list.cpp:228
Tree view widget that presents a filterable, sortable, checkable list of traffic-tap protocols and fo...
Definition traffic_types_list.h:229
void selectProtocols(QList< int > protocols)
Checks the given protocol IDs and unchecks all others.
Definition traffic_types_list.cpp:300
void clearFilterList()
Emitted to request that any external filter input be cleared.
void protocolsChanged(QList< int > protocols)
Emitted when the set of checked protocols changes.
void setProtocolInfo(QString name, GList **recentList)
Initialises the underlying model with the given protocol group name and recent-list pointer,...
Definition traffic_types_list.cpp:281
QList< int > protocols(bool onlySelected=false) const
Returns the list of protocol IDs tracked by this view.
Definition traffic_types_list.cpp:308
void filterList(QString filter)
Applies a name filter to the visible protocol list.
Definition traffic_types_list.cpp:323
List model that exposes all registered traffic-tap protocols with checkable rows, backed by a recent-...
Definition traffic_types_list.h:72
virtual bool setData(const QModelIndex &idx, const QVariant &value, int role) override
Sets data for the given index and role, updating the checked state and emitting protocolsChanged() wh...
Definition traffic_types_list.cpp:154
void selectProtocols(QList< int > protocols)
Replaces the current selection with the given protocol IDs and emits protocolsChanged().
Definition traffic_types_list.cpp:212
enum TrafficTypesModel::@618 eTrafficUserData
Custom Qt::UserRole values for retrieving protocol data from the model.
@ TRAFFIC_IS_CHECKED
Definition traffic_types_list.h:81
@ TRAFFIC_PROTOCOL
Definition traffic_types_list.h:80
@ COL_PROTOCOL
Definition traffic_types_list.h:91
@ COL_NAME
Definition traffic_types_list.h:89
@ COL_NUM
Definition traffic_types_list.h:90
@ COL_CHECKED
Definition traffic_types_list.h:88
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of protocol rows in the model.
Definition traffic_types_list.cpp:99
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns header labels for the traffic-types columns.
Definition traffic_types_list.cpp:135
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the model.
Definition traffic_types_list.cpp:104
void protocolsChanged(QList< int > protocols)
Emitted whenever the set of checked protocols changes.
QList< int > protocols() const
Returns the list of currently checked (selected) protocol IDs.
enum TrafficTypesModel::@619 eTrafficColumnNames
Column indices for the traffic-types table view.
Data record for a single row in the traffic-types protocol list, storing a protocol's numeric ID,...
Definition traffic_types_list.h:27
QString name() const
Returns the human-readable protocol name.
Definition traffic_types_list.cpp:30
void setChecked(bool checked)
Sets the checked (selected) state of this protocol.
Definition traffic_types_list.cpp:40
int protocol() const
Returns the numeric protocol ID.
Definition traffic_types_list.cpp:25
bool checked() const
Returns whether this protocol is currently checked (selected).
Definition traffic_types_list.cpp:35