|
Wireshark 5.1.0
The Wireshark network protocol analyzer
|
A model managing the tagging rules for packet display. More...
#include <tagging_rules_model.h>
Public Types | |
| enum | TaggingRulesColumn { colName = 0 , colFilter = 1 , colTag = 2 , colLink = 3 , colComment = 4 , colCount } |
| Defines the columns used in the tagging rules model. More... | |
| enum | TaggingRulesRole { TagContentRole = Qt::UserRole + 1 , TagUrlRole = Qt::UserRole + 2 } |
| Custom data roles for TaggingRulesModel. More... | |
Public Member Functions | |
| TaggingRulesModel (QObject *parent) | |
| Constructs a new TaggingRulesModel, cloning the current active rule list. | |
| virtual | ~TaggingRulesModel () |
| Destroys the TaggingRulesModel. | |
| void | addRule (bool disabled, const QString &name, const QString &filter, const QString &tag_content, const QString &tag_url, const QString &comment) |
| Adds a new rule with specified properties. | |
| void | addRule (tag_rule_t *rule) |
| Adds a rule from a core tag_rule_t structure (used during cloning). | |
| bool | loadFromPath (const QString &path, QString &err) |
| Load rules from an arbitrary path into the model (replaces current contents). | |
| bool | writeToPath (const QString &path, const tag_prefs_t *prefs, QString &err) |
| Write current model rules to an arbitrary path. | |
| bool | importRules (const QString &path, QString &err) |
| Imports tagging rules from a file, appending to the current model. | |
| bool | exportRules (const QString &path, QString &err) |
| Exports the current tagging rules to a file. | |
| bool | writeTags () |
| Applies the model rules as the active list and writes to the active profile's file. | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Retrieves the item flags for a given index. | |
| QVariant | data (const QModelIndex &index, int role) const override |
| Retrieves data from the model for the given index and role. | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| Sets data in the model for the given index and role. | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Retrieves header data for the given section, orientation, and role. | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| Generates an index for the specified row and column. | |
| QModelIndex | parent (const QModelIndex &indexItem) const override |
| Retrieves the parent index of the specified index. | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows under the given parent. | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns under the given parent. | |
| bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override |
| Inserts rows into the model. | |
| bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override |
| Removes rows from the model. | |
| bool | moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override |
| Moves rows from one location to another within the model. | |
| Qt::DropActions | supportedDropActions () const override |
| Specifies the supported drag and drop actions. | |
| QStringList | mimeTypes () const override |
| Retrieves the list of supported MIME types for drag and drop operations. | |
| QMimeData * | mimeData (const QModelIndexList &indexes) const override |
| Generates MIME data for the specified list of indexes. | |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| Handles dropped MIME data. | |
A model managing the tagging rules for packet display.
Defines the columns used in the tagging rules model.
Custom data roles for TaggingRulesModel.
| Enumerator | |
|---|---|
| TagContentRole | Role for accessing the tag_content_ field. |
| TagUrlRole | Role for accessing the tag_url_ field. |
|
explicit |
Constructs a new TaggingRulesModel, cloning the current active rule list.
| parent | The parent QObject. |
| void TaggingRulesModel::addRule | ( | tag_rule_t * | rule | ) |
Adds a rule from a core tag_rule_t structure (used during cloning).
Copies the rule data and frees the original rule.
| rule | Pointer to the core tag rule structure; freed after copying. |
|
override |
Returns the number of columns under the given parent.
| parent | The parent model index (defaults to an invalid QModelIndex). |
|
override |
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. |
|
override |
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 TaggingRulesModel::exportRules | ( | const QString & | path, |
| QString & | err ) |
Exports the current tagging rules to a file.
| path | Path of the file to write. |
| err | Output string set to an error message on failure. |
|
override |
Retrieves the item flags for a given index.
| index | The model index to query. |
|
override |
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 TaggingRulesModel::importRules | ( | const QString & | path, |
| QString & | err ) |
Imports tagging rules from a file, appending to the current model.
| path | Path of the file to import. |
| err | Output string set to an error message on failure. |
|
override |
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). |
|
override |
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). |
| bool TaggingRulesModel::loadFromPath | ( | const QString & | path, |
| QString & | err ) |
Load rules from an arbitrary path into the model (replaces current contents).
| path | Full path to a tagrules.jsonc file. |
| err | Set to error message on failure. |
|
override |
Generates MIME data for the specified list of indexes.
| indexes | The list of indexes to generate data for. |
|
override |
Retrieves the list of supported MIME types for drag and drop operations.
|
override |
Moves rows from one location to another within the model.
| sourceParent | The parent of the source rows. |
| sourceRow | The first source row. |
| count | The number of rows to move. |
| destinationParent | The parent of the destination. |
| destinationChild | The destination row index. |
|
override |
Retrieves the parent index of the specified index.
| indexItem | The child model index. |
|
override |
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). |
|
override |
Returns the number of rows under the given parent.
| parent | The parent model index (defaults to an invalid QModelIndex). |
|
override |
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). |
|
override |
Specifies the supported drag and drop actions.
| bool TaggingRulesModel::writeTags | ( | ) |
Applies the model rules as the active list and writes to the active profile's file.
| bool TaggingRulesModel::writeToPath | ( | const QString & | path, |
| const tag_prefs_t * | prefs, | ||
| QString & | err ) |
Write current model rules to an arbitrary path.
| path | Full path to write. |
| prefs | Prefs to embed in the file header (may be NULL). |
| err | Set to error message on failure. |