| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

A list model for managing and displaying extracted network credentials. More...

`#include <credentials_model.h>`

Inheritance diagram for CredentialsModel:

## Public Types
enum | { COL_NUM , COL_PROTO , COL_USERNAME , COL_INFO }
| Enumeration of column identifiers in the credentials model. More...
enum | { ColumnHFID = Qt::UserRole + 1 }
| Enumeration of custom roles used in the credentials model. More...

## Public Member Functions
| CredentialsModel (QObject *parent)
| Constructs a new CredentialsModel.
| ~CredentialsModel ()
| Destroys the CredentialsModel.
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override
| Returns the number of rows (credentials) under the given parent.
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override
| Returns the number of columns (data fields) for a credential.
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
| Retrieves data from the model for the given index and role.
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
| Retrieves header data for the given section, orientation, and role.
void | addRecord (const tap_credential_t *rec)
| Adds a new credential record to the model.
void | clear ()
| Clears all credential records from the model.

## Detailed Description

A list model for managing and displaying extracted network credentials.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

Enumeration of custom roles used in the credentials model.

Enumerator
ColumnHFID | Custom role for retrieving the header field ID.

## ◆ anonymous enum

anonymous enum

Enumeration of column identifiers in the credentials model.

Enumerator
COL_NUM | Column for the packet number.
COL_PROTO | Column for the protocol name.
COL_USERNAME | Column for the username.
COL_INFO | Column for additional credential information.

## Constructor & Destructor Documentation

## ◆ CredentialsModel()

CredentialsModel::CredentialsModel | ( | QObject * | parent | ) |

Constructs a new CredentialsModel.

Parameters

  parent | The parent QObject.

## Member Function Documentation

## ◆ addRecord()

void CredentialsModel::addRecord | ( | const tap_credential_t * | rec | ) |

Adds a new credential record to the model.

Parameters

  rec | Pointer to the core tap credential structure to add.

## ◆ columnCount()

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

Returns the number of columns (data fields) for a credential.

Parameters

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

Returns
  The number of columns.

## ◆ data()

QVariant CredentialsModel::data | ( | const QModelIndex & | index,
|  | int | role = Qt::DisplayRole ) const
| override virtual

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

Parameters

  index | The model index to retrieve data for.
  role | The requested data role (defaults to Qt::DisplayRole).

Returns
  The data associated with the index and role.

## ◆ headerData()

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

Retrieves header data for the given section, orientation, and role.

Parameters

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

Returns
  The header data.

## ◆ rowCount()

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

Returns the number of rows (credentials) under the given parent.

Parameters

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

Returns
  The number of credential records.

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

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