| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
SupportedProtocolsProxyModel Class Reference

Sort/filter proxy model for SupportedProtocolsModel that performs case-insensitive substring filtering across name, filter, type, and description columns, and provides natural sorting for each column. More...

`#include <supported_protocols_model.h>`

Inheritance diagram for SupportedProtocolsProxyModel:

## Public Member Functions
| SupportedProtocolsProxyModel (QObject *parent=Q_NULLPTR)
| Constructs the proxy model.
virtual bool | filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
| Determines whether the source row should be visible given the current filter.
void | setFilter (const QString &filter)
| Sets the text filter used to match protocols and fields. An empty string shows all items.

## Protected Member Functions
bool | lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const override
| Compares two source rows for sorting using the active sort column.
bool | filterAcceptItem (SupportedProtocolsItem &item) const
| Tests whether a single SupportedProtocolsItem matches the current filter.

## Detailed Description

Sort/filter proxy model for SupportedProtocolsModel that performs case-insensitive substring filtering across name, filter, type, and description columns, and provides natural sorting for each column.

## Constructor & Destructor Documentation

## ◆ SupportedProtocolsProxyModel()

SupportedProtocolsProxyModel::SupportedProtocolsProxyModel | ( | QObject * | parent = Q_NULLPTR | ) |
| explicit

Constructs the proxy model.

Parameters

  parent | Optional parent QObject.

## Member Function Documentation

## ◆ filterAcceptItem()

bool SupportedProtocolsProxyModel::filterAcceptItem | ( | SupportedProtocolsItem & | item | ) | const
| protected

Tests whether a single SupportedProtocolsItem matches the current filter.

Parameters

  item | The item to test.

Returns
  `true` if any of the item's visible fields contain the filter string.

## ◆ filterAcceptsRow()

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

Determines whether the source row should be visible given the current filter.

Parameters

  sourceRow | Row index in the source model.
  sourceParent | Parent index in the source model.

Returns
  `true` if the row or any of its descendants match the filter.

## ◆ lessThan()

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

Compares two source rows for sorting using the active sort column.

Parameters

  source_left | Index of the left-hand item in the source model.
  source_right | Index of the right-hand item in the source model.

Returns
  `true` if `source_left` should sort before `source_right`.

## ◆ setFilter()

void SupportedProtocolsProxyModel::setFilter | ( | const QString & | filter | ) |

Sets the text filter used to match protocols and fields. An empty string shows all items.

Parameters

  filter | Case-insensitive substring to match against item data.

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

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