| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

Sort/filter proxy model for TrafficTypesModel that supports case-insensitive name filtering and protocol-name–aware sorting. More...

`#include <traffic_types_list.h>`

Inheritance diagram for TrafficListSortModel:

## Public Member Functions
| TrafficListSortModel (QObject *parent=nullptr)
| Constructs the sort/filter proxy model.
void | setFilter (QString filter=QString())
| Sets the text filter used to show only protocols whose name contains the given string (case-insensitive). Pass an empty string to show all.

## Protected Member Functions
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 protocol-ID column.
virtual bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override
| Determines whether a source row should be visible given the current filter.

## Detailed Description

Sort/filter proxy model for TrafficTypesModel that supports case-insensitive name filtering and protocol-name–aware sorting.

## Constructor & Destructor Documentation

## ◆ TrafficListSortModel()

TrafficListSortModel::TrafficListSortModel | ( | QObject * | parent = nullptr | ) |

Constructs the sort/filter proxy model.

Parameters

  parent | Optional parent QObject.

## Member Function Documentation

## ◆ filterAcceptsRow()

bool TrafficListSortModel::filterAcceptsRow | ( | int | source_row,
|  | const QModelIndex & | source_parent ) const
| override protected virtual

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

Parameters

  source_row | Row index in the source model.
  source_parent | Parent index in the source model (unused for list models).

Returns
  `true` if the row's protocol name contains the filter string.

## ◆ lessThan()

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

Compares two rows for sorting, using protocol name for the name column and numeric ordering for the protocol-ID column.

Parameters

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

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

## ◆ setFilter()

void TrafficListSortModel::setFilter | ( | QString | filter = QString() | ) |

Sets the text filter used to show only protocols whose name contains the given string (case-insensitive). Pass an empty string to show all.

Parameters

  filter | Filter string; empty clears the filter.

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

- /builds/wireshark/wireshark/ui/qt/widgets/traffic_types_list.h
- /builds/wireshark/wireshark/ui/qt/widgets/traffic_types_list.cpp