Caches any data read access to the source model, returning an older copy if the source model is invalidated.
More...
#include <cache_proxy_model.h>
|
| | CacheProxyModel (QObject *parent=0) |
| | Constructs a new CacheProxyModel.
|
| |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| | Retrieves data from the model for the given index and role.
|
| |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| | Retrieves the item flags for the given index.
|
| |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| | Retrieves the header data for a given section, orientation, and role.
|
| |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| | Returns the number of rows under the given parent.
|
| |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| | Returns the number of columns under the given parent.
|
| |
| void | setSourceModel (QAbstractItemModel *newSourceModel) |
| | Sets a new source model to be cached and proxied.
|
| |
Caches any data read access to the source model, returning an older copy if the source model is invalidated.
Only flat data is supported at the moment, tree models (with parents) are unsupported.
◆ CacheProxyModel()
| CacheProxyModel::CacheProxyModel |
( |
QObject * |
parent = 0 | ) |
|
Constructs a new CacheProxyModel.
- Parameters
-
| parent | The parent QObject, defaults to 0. |
◆ columnCount()
| int CacheProxyModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
Returns the number of columns under the given parent.
- Parameters
-
| parent | The parent model index (defaults to an invalid QModelIndex). |
- Returns
- The number of columns in the model or cache.
◆ data()
| QVariant CacheProxyModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
Retrieves data from the model for the given index and role.
- Parameters
-
| index | The model index to retrieve data for. |
| role | The role for which the data is requested (defaults to Qt::DisplayRole). |
- Returns
- The data associated with the index and role, returning cached data if the source is invalid.
◆ flags()
| Qt::ItemFlags CacheProxyModel::flags |
( |
const QModelIndex & |
index | ) |
const |
Retrieves the item flags for the given index.
- Parameters
-
| index | The model index to query. |
- Returns
- The item flags for the specified index.
◆ headerData()
| QVariant CacheProxyModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
Retrieves the header data for a given section, orientation, and role.
- Parameters
-
| section | The section (column or row) to retrieve data for. |
| orientation | The orientation of the header. |
| role | The role for which the data is requested (defaults to Qt::DisplayRole). |
- Returns
- The header data for the specified parameters.
◆ rowCount()
| int CacheProxyModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
Returns the number of rows under the given parent.
- Parameters
-
| parent | The parent model index (defaults to an invalid QModelIndex). |
- Returns
- The number of rows in the model or cache.
◆ setSourceModel()
| void CacheProxyModel::setSourceModel |
( |
QAbstractItemModel * |
newSourceModel | ) |
|
Sets a new source model to be cached and proxied.
- Parameters
-
| newSourceModel | A pointer to the new source model. |
Sets the source model from which data must be pulled. If newSourceModel is NULL, then the cache will be used.
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/models/cache_proxy_model.h
- /builds/wireshark/wireshark/ui/qt/models/cache_proxy_model.cpp