| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Types | 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 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

enum DissectorTablesProxyModel::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

  parent | The 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

  currentIndex | The active model index.

## ◆ filterAcceptsRow()

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

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

Parameters

  sourceRow | The row in the source model.
  sourceParent | The 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

  section | The column section.
  orientation | The header orientation.
  role | The requested data role (defaults to Qt::DisplayRole).

Returns
  The header data.

## ◆ lessThan()

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

Compares two source indices to determine their sort order.

Parameters

  source_left | The first source index.
  source_right | The 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

  filter | The filter text.

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

- /builds/wireshark/wireshark/ui/qt/models/dissector_tables_model.h
- /builds/wireshark/wireshark/ui/qt/models/dissector_tables_model.cpp