|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Table model for representing and managing User Accessible Tables (UAT). More...
#include <uat_model.h>
Public Member Functions | |
| UatModel (QObject *parent, uat_t *uat=0) | |
| Constructs a new UatModel object using a UAT structure. | |
| UatModel (QObject *parent, QString tableName) | |
| Constructs a new UatModel object using a UAT table name. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| Returns the item flags for a given index. | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| Retrieves data for a given index and role. | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| Retrieves header data for the table. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| Returns the number of rows under a given parent. | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| Returns the number of columns under a given parent. | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| Sets the data for a specific index. | |
| bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| Inserts a specified number of rows into the model. | |
| bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| Removes a specified number of rows from the model. | |
| QModelIndex | appendEntry (QVariantList row) |
| Appends a new entry to the end of the table. | |
| QModelIndex | copyRow (QModelIndex original) |
| Copies an existing row and inserts the copy. | |
| bool | moveRow (int src_row, int dst_row) |
| Moves a row from one position to another. | |
| bool | moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) |
| Moves multiple rows from one position to another. | |
| Qt::DropActions | supportedDropActions () const |
| Returns the supported drag and drop actions for the model. | |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| Handles dropped MIME data to perform drag and drop operations. | |
| void | reloadUat () |
| Reloads the UAT data from the underlying structure. | |
| bool | hasErrors () const |
| Checks if any records in the model currently have validation errors. | |
| void | clearAll () |
| Clears all entries from the model. | |
| bool | applyChanges (QString &error) |
| bool | revertChanges (QString &error) |
| QModelIndex | findRowForColumnContent (QVariant columnContent, int columnToCheckAgainst, int role=Qt::DisplayRole) |
| Finds the first row containing specific content in a given column. | |
Table model for representing and managing User Accessible Tables (UAT).
| UatModel::UatModel | ( | QObject * | parent, |
| uat_t * | uat = 0 |
||
| ) |
Constructs a new UatModel object using a UAT structure.
| parent | The parent object. |
| uat | Pointer to the UAT structure. |
| UatModel::UatModel | ( | QObject * | parent, |
| QString | tableName | ||
| ) |
Constructs a new UatModel object using a UAT table name.
| parent | The parent object. |
| tableName | The name of the UAT table to load. |
| QModelIndex UatModel::appendEntry | ( | QVariantList | row | ) |
Appends a new entry to the end of the table.
| row | A list of variants representing the new row data. |
| bool UatModel::applyChanges | ( | QString & | error | ) |
If the UAT has changed, save the contents to file and invoke the UAT post_update_cb.
| error | An error while saving changes, if any. |
| int UatModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Returns the number of columns under a given parent.
| parent | The parent model index. |
| QModelIndex UatModel::copyRow | ( | QModelIndex | original | ) |
Copies an existing row and inserts the copy.
| original | The model index of the row to copy. |
| QVariant UatModel::data | ( | const QModelIndex & | index, |
| int | role = Qt::DisplayRole |
||
| ) | const |
Retrieves data for a given index and role.
| index | The model index. |
| role | The requested data role. |
| bool UatModel::dropMimeData | ( | const QMimeData * | data, |
| Qt::DropAction | action, | ||
| int | row, | ||
| int | column, | ||
| const QModelIndex & | parent | ||
| ) |
Handles dropped MIME data to perform drag and drop operations.
| data | The dropped MIME data. |
| action | The drop action requested. |
| row | The target row. |
| column | The target column. |
| parent | The target parent index. |
| QModelIndex UatModel::findRowForColumnContent | ( | QVariant | columnContent, |
| int | columnToCheckAgainst, | ||
| int | role = Qt::DisplayRole |
||
| ) |
Finds the first row containing specific content in a given column.
| columnContent | The content to search for. |
| columnToCheckAgainst | The column index to search within. |
| role | The data role to compare against. |
| Qt::ItemFlags UatModel::flags | ( | const QModelIndex & | index | ) | const |
Returns the item flags for a given index.
| index | The model index. |
| bool UatModel::hasErrors | ( | ) | const |
Checks if any records in the model currently have validation errors.
| QVariant UatModel::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const |
Retrieves header data for the table.
| section | The column or row index. |
| orientation | The orientation of the header. |
| role | The requested data role. |
| bool UatModel::insertRows | ( | int | row, |
| int | count, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) |
Inserts a specified number of rows into the model.
| row | The starting row index. |
| count | The number of rows to insert. |
| parent | The parent model index. |
| bool UatModel::moveRow | ( | int | src_row, |
| int | dst_row | ||
| ) |
Moves a row from one position to another.
| src_row | The source row index. |
| dst_row | The destination row index. |
| bool UatModel::moveRows | ( | const QModelIndex & | sourceParent, |
| int | sourceRow, | ||
| int | count, | ||
| const QModelIndex & | destinationParent, | ||
| int | destinationChild | ||
| ) |
Moves multiple rows from one position to another.
| sourceParent | The source parent index. |
| sourceRow | The starting source row index. |
| count | The number of rows to move. |
| destinationParent | The destination parent index. |
| destinationChild | The destination row index. |
| bool UatModel::removeRows | ( | int | row, |
| int | count, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) |
Removes a specified number of rows from the model.
| row | The starting row index. |
| count | The number of rows to remove. |
| parent | The parent model index. |
| bool UatModel::revertChanges | ( | QString & | error | ) |
Undo any changes to the UAT.
| error | An error while restoring the original UAT, if any. |
| int UatModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Returns the number of rows under a given parent.
| parent | The parent model index. |
| bool UatModel::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role = Qt::EditRole |
||
| ) |
Sets the data for a specific index.
| index | The model index. |
| value | The new value to set. |
| role | The role for the data being set. |
| Qt::DropActions UatModel::supportedDropActions | ( | ) | const |
Returns the supported drag and drop actions for the model.