| Wireshark 4.7.3 The Wireshark network protocol analyzer

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

A proxy model that caches edits and additions to the interface tree before applying them to the source model. More...

`#include <interface_tree_cache_model.h>`

Inheritance diagram for InterfaceTreeCacheModel:

## Public Member Functions
| InterfaceTreeCacheModel (QObject *parent)
| Constructs a new InterfaceTreeCacheModel.
| ~InterfaceTreeCacheModel ()
| Destroys the InterfaceTreeCacheModel.
int | rowCount (const QModelIndex &parent=QModelIndex()) const override
| Returns the number of rows under a given parent.
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override
| Retrieves data from the cache or source model for a given index and role.
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
| Sets data in the cache for a given index and role.
Qt::ItemFlags | flags (const QModelIndex &index) const override
| Retrieves the item flags for a given index, taking cache rules into account.
QVariant | getColumnContent (int idx, int col, int role=Qt::DisplayRole)
| Gets the cached content for a specific column and row.

## Detailed Description

A proxy model that caches edits and additions to the interface tree before applying them to the source model.

## Constructor & Destructor Documentation

## ◆ InterfaceTreeCacheModel()

InterfaceTreeCacheModel::InterfaceTreeCacheModel | ( | QObject * | parent | ) |
| explicit

Constructs a new InterfaceTreeCacheModel.

Parameters

  parent | The parent QObject.

## Member Function Documentation

## ◆ data()

QVariant InterfaceTreeCacheModel::data | ( | const QModelIndex & | index,
|  | int | role = Qt::DisplayRole ) const
| override

Retrieves data from the cache or source model for a given index and role.

Parameters

  index | The model index.
  role | The data role requested (defaults to Qt::DisplayRole).

Returns
  The data associated with the index and role.

## ◆ flags()

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

Retrieves the item flags for a given index, taking cache rules into account.

Parameters

  index | The model index.

Returns
  The item flags.

## ◆ getColumnContent()

QVariant InterfaceTreeCacheModel::getColumnContent | ( | int | idx,
|  | int | col,
|  | int | role = Qt::DisplayRole )

Gets the cached content for a specific column and row.

Parameters

  idx | The row index.
  col | The column index.
  role | The data role (defaults to Qt::DisplayRole).

Returns
  The cached data variant.

## ◆ rowCount()

int InterfaceTreeCacheModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const
| override

Returns the number of rows under a given parent.

Parameters

  parent | The parent model index (defaults to an invalid QModelIndex).

Returns
  The number of rows.

## ◆ setData()

bool InterfaceTreeCacheModel::setData | ( | const QModelIndex & | index,
|  | const QVariant & | value,
|  | int | role = Qt::EditRole )
| override

Sets data in the cache for a given index and role.

Parameters

  index | The model index to update.
  value | The value to set.
  role | The data role being edited (defaults to Qt::EditRole).

Returns
  True if successful, false otherwise.

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

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