Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
DissectorTablesProxyModel Class Reference

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

#include <dissector_tables_model.h>

Inheritance diagram for DissectorTablesProxyModel:

Public Types

enum  SearchType { EveryWhere = 0x0 , OnlyName = 0x1 , OnlyDescription = 0x2 }
 Defines the search filtering scope. More...

Public Member Functions

 DissectorTablesProxyModel (QObject *parent=Q_NULLPTR)
 Constructs a new DissectorTablesProxyModel.
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 Determines whether a row from the source model should be visible.
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 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, SearchTypes type)
 Sets the filter string used to screen items.

Protected Member Functions

bool lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const override
 Compares two source indices to determine their sort order.

Detailed Description

A proxy model that filters and sorts the DissectorTablesModel.

Member Enumeration Documentation

◆ SearchType

Defines the search filtering scope.

Enumerator
EveryWhere 

Search all text fields.

OnlyName 

Search only names.

OnlyDescription 

Search only descriptions.

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.

◆ filterAcceptsRow()

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

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
override

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
overrideprotected

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,
SearchTypes type )

Sets the filter string used to screen items.

Parameters
filterThe filter text.

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