Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
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
parentThe 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
indexThe model index.
roleThe 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
indexThe 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
idxThe row index.
colThe column index.
roleThe 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
parentThe 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
indexThe model index to update.
valueThe value to set.
roleThe 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: