| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

Sort/filter proxy model for the module (left-hand) pane of the Preferences dialog. More...

`#include <pref_models.h>`

Inheritance diagram for ModulePrefsModel:

## Public Types
enum | ModulePrefsModelColumn { colName = 0 , colLast }
| Column indices for the module pane. More...
enum | ModulePrefsRoles { ModuleName = Qt::UserRole + 1 , ModuleHelp = Qt::UserRole + 2 }
| Custom data roles for module items. More...

## Public Member Functions
| ModulePrefsModel (QObject *parent=Q_NULLPTR)
| Construct a ModulePrefsModel.
QVariant | data (const QModelIndex &index, int role) const override
| Return data for `index` under `role`.
Qt::ItemFlags | flags (const QModelIndex &index) const override
| Return the item flags for `index`.
int | columnCount (const QModelIndex &parent=QModelIndex()) const override
| Return the number of columns in this model.
virtual bool | filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
| Determine whether a source row should appear in the module pane.

## Protected Member Functions
bool | lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const override
| Define the sort order for module rows.

## Detailed Description

Sort/filter proxy model for the module (left-hand) pane of the Preferences dialog.

## Member Enumeration Documentation

## ◆ ModulePrefsModelColumn

enum ModulePrefsModel::ModulePrefsModelColumn

Column indices for the module pane.

Enumerator
colName | Module display name.
colLast | Sentinel — total column count.

## ◆ ModulePrefsRoles

enum ModulePrefsModel::ModulePrefsRoles

Custom data roles for module items.

Enumerator
ModuleName | Internal (short) module name string.
ModuleHelp | Module help text string.

## Constructor & Destructor Documentation

## ◆ ModulePrefsModel()

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

Construct a ModulePrefsModel.

Parameters

  parent | The parent QObject.

## Member Function Documentation

## ◆ columnCount()

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

Return the number of columns in this model.

Parameters

  parent | Unused; present for API compatibility.

Returns
  Always `colLast`.

## ◆ data()

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

Return data for `index` under `role`.

Parameters

  index | The proxy model index to query.
  role | The data role.

Returns
  The requested data, or an invalid QVariant if unavailable.

## ◆ filterAcceptsRow()

bool ModulePrefsModel::filterAcceptsRow | ( | int | sourceRow,
|  | const QModelIndex & | sourceParent ) const
| override virtual

Determine whether a source row should appear in the module pane.

Parameters

  sourceRow | The row index in the source model.
  sourceParent | The parent index in the source model.

Returns
  true if the row is a module-level item; false otherwise.

## ◆ flags()

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

Return the item flags for `index`.

Parameters

  index | The proxy model index to query.

Returns
  The item flags for the module at `index`.

## ◆ lessThan()

bool ModulePrefsModel::lessThan | ( | const QModelIndex & | source_left,
|  | const QModelIndex & | source_right ) const
| override protected

Define the sort order for module rows.

Parameters

  source_left | Source index of the left-hand item to compare.
  source_right | Source index of the right-hand item to compare.

Returns
  true if the left item should appear before the right item.

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

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