Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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

Column indices for the module pane.

Enumerator
colName 

Module display name.

colLast 

Sentinel — total column count.

◆ 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
parentThe parent QObject.

Member Function Documentation

◆ columnCount()

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

Return the number of columns in this model.

Parameters
parentUnused; 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
indexThe proxy model index to query.
roleThe data role.
Returns
The requested data, or an invalid QVariant if unavailable.

◆ filterAcceptsRow()

bool ModulePrefsModel::filterAcceptsRow ( int sourceRow,
const QModelIndex & sourceParent ) const
overridevirtual

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

Parameters
sourceRowThe row index in the source model.
sourceParentThe 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
indexThe 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
overrideprotected

Define the sort order for module rows.

Parameters
source_leftSource index of the left-hand item to compare.
source_rightSource 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: