Sort/filter proxy model for TrafficTypesModel that supports case-insensitive name filtering and protocol-name–aware sorting.
More...
#include <traffic_types_list.h>
|
| | TrafficListSortModel (QObject *parent=nullptr) |
| | Constructs the sort/filter proxy model.
|
| |
| void | setFilter (QString filter=QString()) |
| | Sets the text filter used to show only protocols whose name contains the given string (case-insensitive). Pass an empty string to show all.
|
| |
|
| virtual bool | lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const override |
| | Compares two rows for sorting, using protocol name for the name column and numeric ordering for the protocol-ID column.
|
| |
| virtual bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override |
| | Determines whether a source row should be visible given the current filter.
|
| |
Sort/filter proxy model for TrafficTypesModel that supports case-insensitive name filtering and protocol-name–aware sorting.
◆ TrafficListSortModel()
| TrafficListSortModel::TrafficListSortModel |
( |
QObject * |
parent = nullptr | ) |
|
Constructs the sort/filter proxy model.
- Parameters
-
| parent | Optional parent QObject. |
◆ filterAcceptsRow()
| bool TrafficListSortModel::filterAcceptsRow |
( |
int |
source_row, |
|
|
const QModelIndex & |
source_parent |
|
) |
| const |
|
overrideprotectedvirtual |
Determines whether a source row should be visible given the current filter.
- Parameters
-
| source_row | Row index in the source model. |
| source_parent | Parent index in the source model (unused for list models). |
- Returns
true if the row's protocol name contains the filter string.
◆ lessThan()
| bool TrafficListSortModel::lessThan |
( |
const QModelIndex & |
source_left, |
|
|
const QModelIndex & |
source_right |
|
) |
| const |
|
overrideprotectedvirtual |
Compares two rows for sorting, using protocol name for the name column and numeric ordering for the protocol-ID column.
- Parameters
-
| source_left | Index of the left-hand row in the source model. |
| source_right | Index of the right-hand row in the source model. |
- Returns
true if source_left should sort before source_right.
◆ setFilter()
| void TrafficListSortModel::setFilter |
( |
QString |
filter = QString() | ) |
|
Sets the text filter used to show only protocols whose name contains the given string (case-insensitive). Pass an empty string to show all.
- Parameters
-
| filter | Filter string; empty clears the filter. |
The documentation for this class was generated from the following files: