|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
A list model for managing capture filters, display filters, and display macros. More...
#include <filter_list_model.h>
Classes | |
| struct | FilterListValue |
| Represents a single filter entry with a name and an expression. More... | |
Public Types | |
| enum | FilterListType { Display , Capture , DisplayMacro } |
| Defines the type of filter list. More... | |
| enum | { ColumnName , ColumnExpression } |
| Enumerates the columns for the filter list model. More... | |
Public Member Functions | |
| FilterListModel (FilterListType type=FilterListModel::Display, QObject *parent=Q_NULLPTR) | |
| Constructs a new FilterListModel with a specific type. | |
| FilterListModel (QObject *parent=Q_NULLPTR) | |
| Constructs a new FilterListModel. | |
| void | setFilterType (FilterListModel::FilterListType type) |
| Sets the filter type for this model. | |
| FilterListModel::FilterListType | filterType () const |
| Retrieves the current filter type of the model. | |
| QModelIndex | findByName (QString name) |
| Finds a filter by its name. | |
| QModelIndex | findByExpression (QString expression) |
| Finds a filter by its expression. | |
| QModelIndex | addFilter (QString name, QString expression) |
| Adds a new filter to the list. | |
| void | removeFilter (QModelIndex idx) |
| Removes a filter at the specified index. | |
| void | saveList () |
| Saves the current list of filters to persistent storage. | |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows under a given parent. | |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns under a given parent. | |
| virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Retrieves data from the model for a given index and role. | |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
| Sets data in the model for a given index and role. | |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Retrieves the header data for a specific section and role. | |
| virtual Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Retrieves the item flags for a given index. | |
| virtual Qt::DropActions | supportedDropActions () const override |
| Retrieves the drop actions supported by the model. | |
| virtual QStringList | mimeTypes () const override |
| Retrieves the MIME types supported by the model for drag and drop operations. | |
| virtual QMimeData * | mimeData (const QModelIndexList &indexes) const override |
| Creates MIME data representing the given model indices. | |
| virtual bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| Handles dropped MIME data to insert items into the model. | |
A list model for managing capture filters, display filters, and display macros.
| anonymous enum |
|
explicit |
Constructs a new FilterListModel with a specific type.
| type | The type of filter list (defaults to FilterListModel::Display). |
| parent | The parent QObject, defaults to Q_NULLPTR. |
|
explicit |
Constructs a new FilterListModel.
| parent | The parent QObject, defaults to Q_NULLPTR. |
| QModelIndex FilterListModel::addFilter | ( | QString | name, |
| QString | expression | ||
| ) |
Adds a new filter to the list.
| name | The name of the new filter. |
| expression | The expression string of the new filter. |
|
overridevirtual |
Returns the number of columns under a given parent.
| parent | The parent model index (defaults to an invalid QModelIndex). |
|
overridevirtual |
Retrieves data from the model for a given index and role.
| index | The model index. |
| role | The data role requested (defaults to Qt::DisplayRole). |
|
overridevirtual |
Handles dropped MIME data to insert items into the model.
| data | The MIME data dropped. |
| action | The drop action performed. |
| row | The row where the drop occurred. |
| column | The column where the drop occurred. |
| parent | The parent model index. |
| FilterListModel::FilterListType FilterListModel::filterType | ( | ) | const |
Retrieves the current filter type of the model.
| QModelIndex FilterListModel::findByExpression | ( | QString | expression | ) |
Finds a filter by its expression.
| expression | The expression to search for. |
| QModelIndex FilterListModel::findByName | ( | QString | name | ) |
Finds a filter by its name.
| name | The name to search for. |
|
overridevirtual |
Retrieves the item flags for a given index.
| index | The model index. |
|
overridevirtual |
Retrieves the header data for a specific section and role.
| section | The column or row section. |
| orientation | The orientation of the header. |
| role | The data role requested (defaults to Qt::DisplayRole). |
|
overridevirtual |
Creates MIME data representing the given model indices.
| indexes | The list of model indices to encode. |
|
overridevirtual |
Retrieves the MIME types supported by the model for drag and drop operations.
| void FilterListModel::removeFilter | ( | QModelIndex | idx | ) |
Removes a filter at the specified index.
| idx | The model index of the filter to remove. |
|
overridevirtual |
Returns the number of rows under a given parent.
| parent | The parent model index (defaults to an invalid QModelIndex). |
|
overridevirtual |
Sets data in the model for a given index and role.
| index | The model index to update. |
| value | The value to set. |
| role | The role being edited. |
| void FilterListModel::setFilterType | ( | FilterListModel::FilterListType | type | ) |
Sets the filter type for this model.
| type | The filter list type to set. |
|
overridevirtual |
Retrieves the drop actions supported by the model.