Wireshark 4.7.0
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
 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
 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
parentOptional parent QObject.

Member Function Documentation

◆ filterAcceptItem()

bool SupportedProtocolsProxyModel::filterAcceptItem ( SupportedProtocolsItem item) const
protected

Tests whether a single SupportedProtocolsItem matches the current filter.

Parameters
itemThe 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
virtual

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

Parameters
sourceRowRow index in the source model.
sourceParentParent 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
protected

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

Parameters
source_leftIndex of the left-hand item in the source model.
source_rightIndex 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
filterCase-insensitive substring to match against item data.

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