Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
DissectorTablesProxyModel Class Reference

A proxy model that filters and sorts the DissectorTablesModel. More...

#include <dissector_tables_model.h>

Inheritance diagram for DissectorTablesProxyModel:

Public Member Functions

 DissectorTablesProxyModel (QObject *parent=Q_NULLPTR)
 Constructs a new DissectorTablesProxyModel.
 
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const
 Determines whether a row from the source model should be visible.
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 Retrieves header data, potentially adjusted dynamically.
 
void adjustHeader (const QModelIndex &currentIndex)
 Adjusts the header based on the currently selected index.
 
void setFilter (const QString &filter)
 Sets the filter string used to screen items.
 

Protected Member Functions

bool lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const
 Compares two source indices to determine their sort order.
 
bool filterAcceptItem (DissectorTablesItem &item) const
 Checks if an individual item is accepted by the filter.
 

Detailed Description

A proxy model that filters and sorts the DissectorTablesModel.

Constructor & Destructor Documentation

◆ DissectorTablesProxyModel()

DissectorTablesProxyModel::DissectorTablesProxyModel ( QObject *  parent = Q_NULLPTR)
explicit

Constructs a new DissectorTablesProxyModel.

Parameters
parentThe parent QObject, defaults to Q_NULLPTR.

Member Function Documentation

◆ adjustHeader()

void DissectorTablesProxyModel::adjustHeader ( const QModelIndex &  currentIndex)

Adjusts the header based on the currently selected index.

Parameters
currentIndexThe active model index.

◆ filterAcceptItem()

bool DissectorTablesProxyModel::filterAcceptItem ( DissectorTablesItem item) const
protected

Checks if an individual item is accepted by the filter.

Parameters
itemThe DissectorTablesItem to check.
Returns
True if accepted, false otherwise.

◆ filterAcceptsRow()

bool DissectorTablesProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
virtual

Determines whether a row from the source model should be visible.

Parameters
sourceRowThe row in the source model.
sourceParentThe parent index in the source model.
Returns
True if the row is accepted by the current filter, false otherwise.

◆ headerData()

QVariant DissectorTablesProxyModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

Retrieves header data, potentially adjusted dynamically.

Parameters
sectionThe column section.
orientationThe header orientation.
roleThe requested data role (defaults to Qt::DisplayRole).
Returns
The header data.

◆ lessThan()

bool DissectorTablesProxyModel::lessThan ( const QModelIndex &  source_left,
const QModelIndex &  source_right 
) const
protected

Compares two source indices to determine their sort order.

Parameters
source_leftThe first source index.
source_rightThe second source index.
Returns
True if the left item should appear before the right item.

◆ setFilter()

void DissectorTablesProxyModel::setFilter ( const QString &  filter)

Sets the filter string used to screen items.

Parameters
filterThe filter text.

The documentation for this class was generated from the following files: