|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
A model managing the coloring rules for packet display. More...
#include <coloring_rules_model.h>
Public Types | |
| enum | ColoringRulesColumn { colName = 0 , colFilter , colColoringRulesMax } |
| Defines the columns used in the coloring rules model. More... | |
Public Member Functions | |
| ColoringRulesModel (QColor defaultForeground, QColor defaultBackground, QObject *parent) | |
| Constructs a new ColoringRulesModel. | |
| virtual | ~ColoringRulesModel () |
| Destroys the ColoringRulesModel. | |
| void | addColor (color_filter_t *colorf) |
| Adds a new color rule from a core color filter. | |
| void | addColor (bool disabled, QString filter, QColor foreground, QColor background) |
| Adds a new color rule with specified properties. | |
| bool | importColors (QString filename, QString &err) |
| Imports coloring rules from a specified file. | |
| bool | exportColors (QString filename, QString &err) |
| Exports the current coloring rules to a file. | |
| bool | writeColors (QString &err) |
| Writes the coloring rules to the internal configuration. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| Retrieves the item flags for a given index. | |
| QVariant | data (const QModelIndex &index, int role) const |
| Retrieves data from the model for the given index and role. | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| Sets data in the model for the given index and role. | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| Retrieves header data for the given section, orientation, and role. | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
| Generates an index for the specified row and column. | |
| QModelIndex | parent (const QModelIndex &indexItem) const |
| Retrieves the parent index of the specified index. | |
| Qt::DropActions | supportedDropActions () const |
| Specifies the supported drag and drop actions. | |
| QStringList | mimeTypes () const |
| Retrieves the list of supported MIME types for drag and drop operations. | |
| QMimeData * | mimeData (const QModelIndexList &indexes) const |
| Generates MIME data for the specified list of indexes. | |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| Handles dropped MIME data. | |
| 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. | |
| bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| Inserts rows into the model. | |
| bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| Removes rows from the model. | |
| bool | copyRow (int dst_row, int src_row) |
| Copies a row from one index to another. | |
A model managing the coloring rules for packet display.
| ColoringRulesModel::ColoringRulesModel | ( | QColor | defaultForeground, |
| QColor | defaultBackground, | ||
| QObject * | parent | ||
| ) |
Constructs a new ColoringRulesModel.
| defaultForeground | The default foreground color. |
| defaultBackground | The default background color. |
| parent | The parent QObject. |
| void ColoringRulesModel::addColor | ( | bool | disabled, |
| QString | filter, | ||
| QColor | foreground, | ||
| QColor | background | ||
| ) |
Adds a new color rule with specified properties.
| disabled | True if the rule is disabled. |
| filter | The filter string for the rule. |
| foreground | The foreground color. |
| background | The background color. |
| void ColoringRulesModel::addColor | ( | color_filter_t * | colorf | ) |
Adds a new color rule from a core color filter.
| colorf | Pointer to the core color filter structure. |
| int ColoringRulesModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Returns the number of columns under the given parent.
| parent | The parent model index (defaults to an invalid QModelIndex). |
| bool ColoringRulesModel::copyRow | ( | int | dst_row, |
| int | src_row | ||
| ) |
Copies a row from one index to another.
| dst_row | The destination row index. |
| src_row | The source row index. |
| QVariant ColoringRulesModel::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const |
Retrieves data from the model for the given index and role.
| index | The model index to retrieve data for. |
| role | The role for which data is requested. |
| bool ColoringRulesModel::dropMimeData | ( | const QMimeData * | data, |
| Qt::DropAction | action, | ||
| int | row, | ||
| int | column, | ||
| const QModelIndex & | parent | ||
| ) |
Handles dropped MIME data.
| data | The MIME data being dropped. |
| action | The drop action being performed. |
| row | The target row for the drop. |
| column | The target column for the drop. |
| parent | The target parent index. |
| bool ColoringRulesModel::exportColors | ( | QString | filename, |
| QString & | err | ||
| ) |
Exports the current coloring rules to a file.
| filename | The name of the file to export to. |
| err | Output string for error messages. |
| Qt::ItemFlags ColoringRulesModel::flags | ( | const QModelIndex & | index | ) | const |
Retrieves the item flags for a given index.
| index | The model index to query. |
| QVariant ColoringRulesModel::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const |
Retrieves header data for the given section, orientation, and role.
| section | The column or row section. |
| orientation | The orientation of the header. |
| role | The role for which data is requested (defaults to Qt::DisplayRole). |
| bool ColoringRulesModel::importColors | ( | QString | filename, |
| QString & | err | ||
| ) |
Imports coloring rules from a specified file.
| filename | The name of the file to import. |
| err | Output string for error messages. |
| QModelIndex ColoringRulesModel::index | ( | int | row, |
| int | column, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) | const |
Generates an index for the specified row and column.
| row | The row number. |
| column | The column number. |
| parent | The parent model index (defaults to an invalid QModelIndex). |
| bool ColoringRulesModel::insertRows | ( | int | row, |
| int | count, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) |
Inserts rows into the model.
| row | The starting row index for insertion. |
| count | The number of rows to insert. |
| parent | The parent model index (defaults to an invalid QModelIndex). |
| QMimeData * ColoringRulesModel::mimeData | ( | const QModelIndexList & | indexes | ) | const |
Generates MIME data for the specified list of indexes.
| indexes | The list of indexes to generate data for. |
| QStringList ColoringRulesModel::mimeTypes | ( | ) | const |
Retrieves the list of supported MIME types for drag and drop operations.
| QModelIndex ColoringRulesModel::parent | ( | const QModelIndex & | indexItem | ) | const |
Retrieves the parent index of the specified index.
| indexItem | The child model index. |
| bool ColoringRulesModel::removeRows | ( | int | row, |
| int | count, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) |
Removes rows from the model.
| row | The starting row index for removal. |
| count | The number of rows to remove. |
| parent | The parent model index (defaults to an invalid QModelIndex). |
| int ColoringRulesModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Returns the number of rows under the given parent.
| parent | The parent model index (defaults to an invalid QModelIndex). |
| bool ColoringRulesModel::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role = Qt::EditRole |
||
| ) |
Sets data in the model for the given index and role.
| index | The model index to update. |
| value | The value to set. |
| role | The role for which data is being set (defaults to Qt::EditRole). |
| Qt::DropActions ColoringRulesModel::supportedDropActions | ( | ) | const |
Specifies the supported drag and drop actions.
| bool ColoringRulesModel::writeColors | ( | QString & | err | ) |
Writes the coloring rules to the internal configuration.
| err | Output string for error messages. |