Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
EnabledProtocolsProxyModel Class Reference

A proxy model used for filtering and sorting the enabled protocols model. More...

#include <enabled_protocols_model.h>

Inheritance diagram for EnabledProtocolsProxyModel:

Public Types

enum  SearchType {
  EveryWhere , OnlyProtocol , OnlyDescription , EnabledItems ,
  DisabledItems
}
 Defines the search filtering scope. More...
 
enum  EnableType { Enable , Disable , Invert }
 Defines the action type when batch enabling/disabling items. More...
 

Public Member Functions

 EnabledProtocolsProxyModel (QObject *parent=Q_NULLPTR)
 Constructs a new EnabledProtocolsProxyModel.
 
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 Determines whether a row from the source model should be displayed.
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const override
 Retrieves item flags, taking into account any proxy state modifications.
 
void setFilter (const QString &filter, EnabledProtocolsProxyModel::SearchType type, EnabledProtocolItem::EnableProtocolType protocolType)
 Sets the active filter criteria.
 
void setItemsEnable (EnabledProtocolsProxyModel::EnableType enable, QModelIndex parent=QModelIndex())
 Applies an enable/disable action to a parent item and all its children.
 

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 used for filtering and sorting the enabled protocols model.

Member Enumeration Documentation

◆ EnableType

Defines the action type when batch enabling/disabling items.

Enumerator
Enable 

Enable items.

Disable 

Disable items.

Invert 

Invert the enable state.

◆ SearchType

Defines the search filtering scope.

Enumerator
EveryWhere 

Search all text fields.

OnlyProtocol 

Search only protocol names.

OnlyDescription 

Search only protocol descriptions.

EnabledItems 

Show only enabled items.

DisabledItems 

Show only disabled items.

Constructor & Destructor Documentation

◆ EnabledProtocolsProxyModel()

EnabledProtocolsProxyModel::EnabledProtocolsProxyModel ( QObject *  parent = Q_NULLPTR)
explicit

Constructs a new EnabledProtocolsProxyModel.

Parameters
parentThe parent QObject, defaults to Q_NULLPTR.

Member Function Documentation

◆ filterAcceptsRow()

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

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

Parameters
sourceRowThe row in the source model.
sourceParentThe parent index in the source model.
Returns
True if the row is accepted, false otherwise.

◆ flags()

Qt::ItemFlags EnabledProtocolsProxyModel::flags ( const QModelIndex &  index) const
overridevirtual

Retrieves item flags, taking into account any proxy state modifications.

Parameters
indexThe proxy model index.
Returns
The item flags.

◆ lessThan()

bool EnabledProtocolsProxyModel::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 EnabledProtocolsProxyModel::setFilter ( const QString &  filter,
EnabledProtocolsProxyModel::SearchType  type,
EnabledProtocolItem::EnableProtocolType  protocolType 
)

Sets the active filter criteria.

Parameters
filterThe text/pattern to filter by.
typeThe search scope for the text.
protocolTypeThe specific protocol type (e.g., Any, Standard) to filter by.

◆ setItemsEnable()

void EnabledProtocolsProxyModel::setItemsEnable ( EnabledProtocolsProxyModel::EnableType  enable,
QModelIndex  parent = QModelIndex() 
)

Applies an enable/disable action to a parent item and all its children.

Parameters
enableThe action to apply (Enable, Disable, Invert).
parentThe parent model index to act upon (defaults to root).

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