A table model representing the system's available capture interfaces.
More...
#include <interface_tree_model.h>
|
| | InterfaceTreeModel (QObject *parent) |
| | Constructs a new InterfaceTreeModel.
|
| |
|
| ~InterfaceTreeModel () |
| | Destroys the InterfaceTreeModel.
|
| |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| | Returns the number of rows (interfaces) under a given parent.
|
| |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| | Returns the number of columns in the table model.
|
| |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| | Retrieves data from the model for a given index and role.
|
| |
| QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
| | Retrieves the header data for a specific section and role.
|
| |
| void | updateStatistic (unsigned int row) |
| | Triggers an update of the statistics (like sparklines) for a specific row.
|
| |
| QString | interfaceError () |
| | Retrieves any current interface-related error messages.
|
| |
| QItemSelection | selectedDevices () |
| | Retrieves the currently selected devices as an item selection.
|
| |
| bool | updateSelectedDevices (QItemSelection sourceSelection) |
| | Updates the internal state of selected devices based on a UI selection.
|
| |
| QVariant | getColumnContent (int idx, int col, int role=Qt::DisplayRole) |
| | Gets the content for a specific column and row directly.
|
| |
A table model representing the system's available capture interfaces.
◆ InterfaceTreeModel()
| InterfaceTreeModel::InterfaceTreeModel |
( |
QObject * |
parent | ) |
|
Constructs a new InterfaceTreeModel.
- Parameters
-
| parent | The parent QObject. |
This is the data model for interface trees. It implies, that the index within global_capture_opts.all_ifaces is identical to the row. This is always the case, even when interfaces are hidden by the proxy model. But for this to work, every access to the index from within the view, has to be filtered through the proxy model.
◆ columnCount()
| int InterfaceTreeModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
Returns the number of columns in the table model.
- Parameters
-
| parent | The parent model index (defaults to an invalid QModelIndex). |
- Returns
- The number of columns.
◆ data()
| QVariant InterfaceTreeModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
Retrieves data from the 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.
◆ getColumnContent()
| QVariant InterfaceTreeModel::getColumnContent |
( |
int |
idx, |
|
|
int |
col, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| |
Gets the content for a specific column and row directly.
- Parameters
-
| idx | The row index. |
| col | The column index. |
| role | The data role (defaults to Qt::DisplayRole). |
- Returns
- The requested data variant.
◆ headerData()
| QVariant InterfaceTreeModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role |
|
) |
| const |
Retrieves the header data for a specific section and role.
- Parameters
-
| section | The column or row section. |
| orientation | The orientation of the header. |
| role | The data role requested. |
- Returns
- The header data.
◆ interfaceError()
| QString InterfaceTreeModel::interfaceError |
( |
| ) |
|
Retrieves any current interface-related error messages.
- Returns
- The error message string.
◆ interfaceListChanged
| void InterfaceTreeModel::interfaceListChanged |
( |
| ) |
|
|
slot |
Slot triggered when the global list of available interfaces changes.
The interface list has changed. global_capture_opts.all_ifaces may have been reloaded or changed with current data. beginResetModel() and endResetModel() will signalize the proxy model and the view, that the data has changed and the view has to reload
◆ rowCount()
| int InterfaceTreeModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
Returns the number of rows (interfaces) under a given parent.
- Parameters
-
| parent | The parent model index (defaults to an invalid QModelIndex). |
- Returns
- The number of rows.
◆ selectedDevices()
| QItemSelection InterfaceTreeModel::selectedDevices |
( |
| ) |
|
Retrieves the currently selected devices as an item selection.
- Returns
- A QItemSelection representing the selected interfaces.
◆ updateSelectedDevices()
| bool InterfaceTreeModel::updateSelectedDevices |
( |
QItemSelection |
sourceSelection | ) |
|
Updates the internal state of selected devices based on a UI selection.
- Parameters
-
| sourceSelection | The selection from the view. |
- Returns
- True if the selection state changed successfully, false otherwise.
◆ updateStatistic()
| void InterfaceTreeModel::updateStatistic |
( |
unsigned int |
row | ) |
|
Triggers an update of the statistics (like sparklines) for a specific row.
- Parameters
-
| row | The row index of the interface to update. |
◆ DefaultNumericValue
| const QString InterfaceTreeModel::DefaultNumericValue = QObject::tr("default") |
|
static |
A default placeholder string for unavailable numeric values.
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/models/interface_tree_model.h
- /builds/wireshark/wireshark/ui/qt/models/interface_tree_model.cpp