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

Tree model backing the Preferences dialog. More...

#include <pref_models.h>

Inheritance diagram for PrefsModel:

Public Types

enum  PrefsModelType {
  Advanced = Qt::UserRole , Appearance , Layout , Columns ,
  FontAndColors , WelcomePage , Capture , Expert ,
  FilterButtons , RSAKeys , Aggregation
}
 Top-level preference page type identifiers. More...
 
enum  PrefsModelColumn {
  colName = 0 , colStatus , colType , colValue ,
  colLast
}
 Column indices for the raw PrefsModel tree. More...
 

Public Member Functions

 PrefsModel (QObject *parent=Q_NULLPTR)
 Construct a PrefsModel and populate it from the preference registry.
 
virtual ~PrefsModel ()
 Destroy the model and its PrefsItem tree.
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 Return the model index for the item at (row, column) under parent.
 
QModelIndex parent (const QModelIndex &index) const
 Return the parent model index of index.
 
QVariant data (const QModelIndex &index, int role) const
 Return data for index under role.
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 Return the number of child rows under parent.
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 Return the number of columns.
 

Static Public Member Functions

static QString typeToString (PrefsModelType type)
 Return the display name for a built-in preference page type.
 
static QString typeToHelp (PrefsModelType type)
 Return the help text for a built-in preference page type.
 

Detailed Description

Tree model backing the Preferences dialog.

Member Enumeration Documentation

◆ PrefsModelColumn

Column indices for the raw PrefsModel tree.

Enumerator
colName 

Module or preference name.

colStatus 

Default / changed status indicator.

colType 

Preference type string.

colValue 

Current preference value.

colLast 

Sentinel — total column count.

◆ PrefsModelType

Top-level preference page type identifiers.

Enumerator
Advanced 

Flat list of all individual preference values.

Appearance 

Appearance settings page.

Layout 

Layout settings page.

Columns 

Packet list column settings page.

FontAndColors 

Font and color settings page.

WelcomePage 

Welcome / start page settings.

Capture 

Capture settings page.

Expert 

Expert information settings page.

FilterButtons 

Filter toolbar button settings page.

RSAKeys 

RSA key decryption settings page.

Aggregation 

Aggregation settings page.

Constructor & Destructor Documentation

◆ PrefsModel()

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

Construct a PrefsModel and populate it from the preference registry.

Parameters
parentThe parent QObject.

Member Function Documentation

◆ columnCount()

int PrefsModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

Return the number of columns.

Parameters
parentUnused; present for API compatibility.
Returns
Always colLast.

◆ data()

QVariant PrefsModel::data ( const QModelIndex &  index,
int  role 
) const

Return data for index under role.

Parameters
indexThe model index to query.
roleThe data role (Qt::DisplayRole, Qt::UserRole, etc.).
Returns
The requested data, or an invalid QVariant if unavailable.

◆ index()

QModelIndex PrefsModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

Return the model index for the item at (row, column) under parent.

Parameters
rowRow within the parent item.
columnColumn index.
parentParent model index; invalid index denotes the root.
Returns
The model index for the requested item.

◆ parent()

QModelIndex PrefsModel::parent ( const QModelIndex &  index) const

Return the parent model index of index.

Parameters
indexA valid model index.
Returns
The model index of index's parent, or an invalid index for top-level items.

◆ rowCount()

int PrefsModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

Return the number of child rows under parent.

Parameters
parentThe parent model index; invalid index = root.
Returns
The number of direct children.

◆ typeToHelp()

QString PrefsModel::typeToHelp ( PrefsModelType  type)
static

Return the help text for a built-in preference page type.

Parameters
typeThe PrefsModelType to look up.
Returns
A translated help string, or an empty string if none is defined.

◆ typeToString()

QString PrefsModel::typeToString ( PrefsModelType  type)
static

Return the display name for a built-in preference page type.

Parameters
typeThe PrefsModelType to look up.
Returns
A translated, human-readable page name string.

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