Wireshark 4.7.0
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
 Returns the number of rows (credentials) under the given parent.
 
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
 Returns the number of columns (data fields) for a credential.
 
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Retrieves data from the model for the given index and role.
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 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 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.

◆ anonymous enum

anonymous enum

Enumeration of custom roles used in the credentials model.

Enumerator
ColumnHFID 

Custom role for retrieving the header field ID.

Constructor & Destructor Documentation

◆ CredentialsModel()

CredentialsModel::CredentialsModel ( QObject *  parent)

Constructs a new CredentialsModel.

Parameters
parentThe parent QObject.

Member Function Documentation

◆ addRecord()

void CredentialsModel::addRecord ( const tap_credential_t rec)

Adds a new credential record to the model.

Parameters
recPointer to the core tap credential structure to add.

◆ columnCount()

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

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

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

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

Parameters
indexThe model index to retrieve data for.
roleThe 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
virtual

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

Parameters
sectionThe column or row section.
orientationThe orientation of the header.
roleThe requested data role (defaults to Qt::DisplayRole).
Returns
The header data.

◆ rowCount()

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

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

Parameters
parentThe 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: