Sort/filter proxy model for ProfileModel, supporting filtering by profile visibility (all, personal, or global) and a text search string.
More...
#include <profile_model.h>
|
| static QStringList | filterTypes () |
| | Returns a localised list of filter type display names, ordered by FilterType value.
|
| |
|
| virtual bool | lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const |
| | Compares two rows for sort ordering, placing personal profiles before global ones and sorting alphabetically within each group.
|
| |
| virtual bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const |
| | Determines whether a source row passes the active scope and text filters.
|
| |
Sort/filter proxy model for ProfileModel, supporting filtering by profile visibility (all, personal, or global) and a text search string.
◆ FilterType
Controls which profiles are visible based on their scope.
| Enumerator |
|---|
| AllProfiles | Show both personal and global profiles.
|
| PersonalProfiles | Show only user-owned personal profiles.
|
| GlobalProfiles | Show only read-only global profiles.
|
◆ ProfileSortModel()
| ProfileSortModel::ProfileSortModel |
( |
QObject * |
parent = Q_NULLPTR | ) |
|
Constructs a ProfileSortModel with no active text filter and AllProfiles visibility.
- Parameters
-
| parent | Optional parent QObject. |
◆ filterAcceptsRow()
| bool ProfileSortModel::filterAcceptsRow |
( |
int |
source_row, |
|
|
const QModelIndex & |
source_parent |
|
) |
| const |
|
protectedvirtual |
Determines whether a source row passes the active scope and text filters.
- Parameters
-
| source_row | Row index in the source model. |
| source_parent | Parent index in the source model (unused for table models). |
- Returns
true if the row should be included in the filtered view.
◆ filterTypes()
| QStringList ProfileSortModel::filterTypes |
( |
| ) |
|
|
static |
Returns a localised list of filter type display names, ordered by FilterType value.
- Returns
- QStringList of filter type labels suitable for a combo box.
◆ lessThan()
| bool ProfileSortModel::lessThan |
( |
const QModelIndex & |
source_left, |
|
|
const QModelIndex & |
source_right |
|
) |
| const |
|
protectedvirtual |
Compares two rows for sort ordering, placing personal profiles before global ones and sorting alphabetically within each group.
- Parameters
-
| source_left | Index of the left-hand item in the source model. |
| source_right | Index of the right-hand item in the source model. |
- Returns
true if the left item should sort before the right item.
◆ setFilterString()
| void ProfileSortModel::setFilterString |
( |
QString |
txt = QString() | ) |
|
Sets a case-insensitive substring filter applied to profile names.
- Parameters
-
| txt | Filter string; pass an empty string to clear the filter. |
◆ setFilterType()
| void ProfileSortModel::setFilterType |
( |
FilterType |
ft | ) |
|
Sets the profile-scope filter.
- Parameters
-
| ft | The FilterType to apply. |
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/models/profile_model.h
- /builds/wireshark/wireshark/ui/qt/models/profile_model.cpp