| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

A single node in the PrefsModel tree. More...

`#include <pref_models.h>`

Inheritance diagram for PrefsItem:

## Public Member Functions
| PrefsItem (module_t *module, pref_t *pref, PrefsItem *parent)
| Construct a PrefsItem for an individual preference.
| PrefsItem (const QString name, PrefsItem *parent)
| Construct a PrefsItem for a named grouping node.
| PrefsItem (PrefsModel::PrefsModelType type, PrefsItem *parent)
| Construct a PrefsItem for a built-in preference page.
virtual | ~PrefsItem ()
| Destroy this PrefsItem and all of its children.
QString | getName () const
| Return the display name of this item.
pref_t * | getPref () const
| Return the pref_t this item represents.
int | getPrefType () const
| Return the numeric type of the underlying preference.
bool | isPrefDefault () const
| Return whether the preference currently holds its default value.
QString | getPrefTypeName () const
| Return a human-readable string for the preference type.
module_t * | getModule () const
| Return the preference module associated with this item.
QString | getModuleName () const
| Return the internal (short) name of the associated module.
QString | getModuleTitle () const
| Return the display title of the associated module.
QString | getModuleHelp () const
| Return the help text for the associated module.
void | setChanged (bool changed=true)
| Mark this preference as having been changed during this session.
Public Member Functions inherited from ModelHelperTreeItem< PrefsItem >
| ModelHelperTreeItem (PrefsItem *parent)
| Constructs a new ModelHelperTreeItem.
virtual | ~ModelHelperTreeItem ()
| Destroys the ModelHelperTreeItem and its children.
void | appendChild (PrefsItem *child)
| Appends a child item to the end of the children list.
void | prependChild (PrefsItem *child)
| Prepends a child item to the beginning of the children list.
void | insertChild (int row, PrefsItem *child)
| Inserts a child item at the specified row.
void | removeChild (int row)
| Removes and deletes the child item at the specified row.
PrefsItem * | child (int row)
| Retrieves the child item at the specified row.
int | childCount () const
| Gets the total number of child items.
int | row ()
| Gets the row index of this item relative to its parent.
PrefsItem * | parentItem ()
| Retrieves the parent item.

## Additional Inherited Members
Protected Attributes inherited from ModelHelperTreeItem< PrefsItem >
PrefsItem * | parent_
QList< QVariant > | childItems_

## Detailed Description

A single node in the PrefsModel tree.

## Constructor & Destructor Documentation

## ◆ PrefsItem() [1/3]

PrefsItem::PrefsItem | ( | module_t * | module,
|  | pref_t * | pref,
|  | PrefsItem * | parent )

Construct a PrefsItem for an individual preference.

Parameters

  module | The preference module that owns `pref`.
  pref | The individual preference value this item represents.
  parent | The parent PrefsItem in the tree.

## ◆ PrefsItem() [2/3]

PrefsItem::PrefsItem | ( | const QString | name,
|  | PrefsItem * | parent )

Construct a PrefsItem for a named grouping node.

Parameters

  name | The display name for this grouping node.
  parent | The parent PrefsItem in the tree.

## ◆ PrefsItem() [3/3]

PrefsItem::PrefsItem | ( | PrefsModel::PrefsModelType | type,
|  | PrefsItem * | parent )

Construct a PrefsItem for a built-in preference page.

Parameters

  type | The PrefsModelType this item represents.
  parent | The parent PrefsItem in the tree.

## Member Function Documentation

## ◆ getModule()

module_t * PrefsItem::getModule | ( |  | ) | const
| inline

Return the preference module associated with this item.

Returns
  The `module_t` pointer, or nullptr for page nodes.

## ◆ getModuleHelp()

QString PrefsItem::getModuleHelp | ( |  | ) | const

Return the help text for the associated module.

Returns
  The module's help string, or an empty string if unavailable.

## ◆ getModuleName()

QString PrefsItem::getModuleName | ( |  | ) | const

Return the internal (short) name of the associated module.

Returns
  The module's `name` field, or an empty string if unavailable.

## ◆ getModuleTitle()

QString PrefsItem::getModuleTitle | ( |  | ) | const

Return the display title of the associated module.

Returns
  The module's `title` field, or an empty string if unavailable.

## ◆ getName()

QString PrefsItem::getName | ( |  | ) | const
| inline

Return the display name of this item.

Returns
  The name string set at construction time.

## ◆ getPref()

pref_t * PrefsItem::getPref | ( |  | ) | const
| inline

Return the pref_t this item represents.

Returns
  The `pref_t` pointer, or nullptr for module/page nodes.

## ◆ getPrefType()

int PrefsItem::getPrefType | ( |  | ) | const

Return the numeric type of the underlying preference.

Returns
  The `pref_t` type constant, or 0 if this is not a pref node.

## ◆ getPrefTypeName()

QString PrefsItem::getPrefTypeName | ( |  | ) | const

Return a human-readable string for the preference type.

Returns
  A type name such as `"uint"`, `"string"`, `"enum"`, etc.

## ◆ isPrefDefault()

bool PrefsItem::isPrefDefault | ( |  | ) | const

Return whether the preference currently holds its default value.

Returns
  true if the preference value equals its compiled-in default.

## ◆ setChanged()

void PrefsItem::setChanged | ( | bool | changed = true | ) |

Mark this preference as having been changed during this session.

Parameters

  changed | true to mark as changed; false to clear the flag.

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