| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

A tree model managing the list of all standard and heuristic protocols. More...

`#include <enabled_protocols_model.h>`

Inheritance diagram for EnabledProtocolsModel:

## Public Types
enum | EnabledProtocolsColumn { colProtocol = 0 , colDescription , colLast }
| Enumerates the columns for the enabled protocols model. More...
enum | EnableProtocolData { DATA_ENABLE = Qt::UserRole , DATA_PROTOCOL_TYPE }
| Enumerates the custom data roles for the enabled protocols model. More...

## Public Member Functions
| EnabledProtocolsModel (QObject *parent=Q_NULLPTR)
| Constructs a new EnabledProtocolsModel.
virtual | ~EnabledProtocolsModel ()
| Destroys the EnabledProtocolsModel.
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
| Generates an index for the given row and column.
QModelIndex | parent (const QModelIndex &index) const override
| Retrieves the parent of a given index.
Qt::ItemFlags | flags (const QModelIndex &index) const override
| Retrieves the item flags for a given index.
QVariant | data (const QModelIndex &index, int role) const override
| Retrieves data from the model for a given index and role.
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
| Sets data in the model for a given index and role.
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
| Retrieves the header data for a specific section and role.
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
| Returns the number of rows under a given parent.
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
| Returns the number of columns under a given parent.
void | populate ()
| Populates the model with protocols from the core engine.
void | applyChanges (bool writeChanges=true)
| Applies pending changes to the core protocol definitions.

## Static Public Member Functions
static void | disableProtocol (struct _protocol *protocol)
| Disables a specific protocol directly in the core.

## Static Protected Member Functions
static void | saveChanges (bool writeChanges=true)
| Triggers the core mechanism to save protocol changes.

## Detailed Description

A tree model managing the list of all standard and heuristic protocols.

## Member Enumeration Documentation

## ◆ EnabledProtocolsColumn

enum EnabledProtocolsModel::EnabledProtocolsColumn

Enumerates the columns for the enabled protocols model.

Enumerator
colProtocol | Protocol name column.
colDescription | Protocol description column.
colLast | End of columns marker.

## ◆ EnableProtocolData

enum EnabledProtocolsModel::EnableProtocolData

Enumerates the custom data roles for the enabled protocols model.

Enumerator
DATA_ENABLE | Role to access the enable state.
DATA_PROTOCOL_TYPE | Role to access the protocol type.

## Constructor & Destructor Documentation

## ◆ EnabledProtocolsModel()

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

Constructs a new EnabledProtocolsModel.

Parameters

  parent | The parent QObject, defaults to Q_NULLPTR.

## Member Function Documentation

## ◆ applyChanges()

void EnabledProtocolsModel::applyChanges | ( | bool | writeChanges = true | ) |

Applies pending changes to the core protocol definitions.

Parameters

  writeChanges | True to write changes out to the configuration file (defaults to true).

## ◆ columnCount()

int EnabledProtocolsModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const
| override

Returns the number of columns under a given parent.

Parameters

  parent | The parent model index (defaults to an invalid QModelIndex).

Returns
  The number of columns.

## ◆ data()

QVariant EnabledProtocolsModel::data | ( | const QModelIndex & | index,
|  | int | role ) const
| override

Retrieves data from the model for a given index and role.

Parameters

  index | The model index.
  role | The data role requested.

Returns
  The data associated with the index and role.

## ◆ disableProtocol()

void EnabledProtocolsModel::disableProtocol | ( | struct _protocol * | protocol | ) |
| static

Disables a specific protocol directly in the core.

Parameters

  protocol | Pointer to the core protocol structure.

## ◆ flags()

Qt::ItemFlags EnabledProtocolsModel::flags | ( | const QModelIndex & | index | ) | const
| override

Retrieves the item flags for a given index.

Parameters

  index | The model index.

Returns
  The item flags.

## ◆ headerData()

QVariant EnabledProtocolsModel::headerData | ( | int | section,
|  | Qt::Orientation | orientation,
|  | int | role = Qt::DisplayRole ) const
| override

Retrieves the header data for a specific section and role.

Parameters

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

Returns
  The header data.

## ◆ index()

QModelIndex EnabledProtocolsModel::index | ( | int | row,
|  | int | column,
|  | const QModelIndex & | parent = QModelIndex() ) const
| override

Generates an index for the given row and column.

Parameters

  row | The row index.
  column | The column index.
  parent | The parent index (defaults to an invalid QModelIndex).

Returns
  The corresponding model index.

## ◆ parent()

QModelIndex EnabledProtocolsModel::parent | ( | const QModelIndex & | index | ) | const
| override

Retrieves the parent of a given index.

Parameters

  index | The child model index.

Returns
  The parent model index.

## ◆ rowCount()

int EnabledProtocolsModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const
| override

Returns the number of rows under a given parent.

Parameters

  parent | The parent model index (defaults to an invalid QModelIndex).

Returns
  The number of rows.

## ◆ saveChanges()

void EnabledProtocolsModel::saveChanges | ( | bool | writeChanges = true | ) |
| static protected

Triggers the core mechanism to save protocol changes.

Parameters

  writeChanges | True to save to disk (defaults to true).

## ◆ setData()

bool EnabledProtocolsModel::setData | ( | const QModelIndex & | index,
|  | const QVariant & | value,
|  | int | role = Qt::EditRole )
| override

Sets data in the model for a given index and role.

Parameters

  index | The model index to update.
  value | The value to set.
  role | The role being edited (defaults to Qt::EditRole).

Returns
  True if successful, false otherwise.

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

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