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>
|
| | InterfaceTreeCacheModel (QObject *parent) |
| | Constructs a new InterfaceTreeCacheModel.
|
| |
|
| ~InterfaceTreeCacheModel () |
| | Destroys the InterfaceTreeCacheModel.
|
| |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| | Returns the number of rows under a given parent.
|
| |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| | 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) |
| | Sets data in the cache for a given index and role.
|
| |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| | 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.
|
| |
A proxy model that caches edits and additions to the interface tree before applying them to the source model.
◆ InterfaceTreeCacheModel()
| InterfaceTreeCacheModel::InterfaceTreeCacheModel |
( |
QObject * |
parent | ) |
|
|
explicit |
◆ data()
| QVariant InterfaceTreeCacheModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
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 |
Retrieves the item flags for a given index, taking cache rules into account.
- Parameters
-
- 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 |
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 |
|
) |
| |
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