| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ProfileSortModel Class Reference

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>`

Inheritance diagram for ProfileSortModel:

## Public Types
enum | FilterType { AllProfiles = 0 , PersonalProfiles , GlobalProfiles }
| Controls which profiles are visible based on their scope. More...

## Public Member Functions
| ProfileSortModel (QObject *parent=Q_NULLPTR)
| Constructs a ProfileSortModel with no active text filter and AllProfiles visibility.
void | setFilterType (FilterType ft)
| Sets the profile-scope filter.
void | setFilterString (QString txt=QString())
| Sets a case-insensitive substring filter applied to profile names.

## Static Public Member Functions
static QStringList | filterTypes ()
| Returns a localised list of filter type display names, ordered by FilterType value.

## Protected Member Functions
virtual bool | lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const override
| 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 override
| Determines whether a source row passes the active scope and text filters.

## Detailed Description

Sort/filter proxy model for ProfileModel, supporting filtering by profile visibility (all, personal, or global) and a text search string.

## Member Enumeration Documentation

## ◆ FilterType

enum ProfileSortModel::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.

## Constructor & Destructor Documentation

## ◆ ProfileSortModel()

ProfileSortModel::ProfileSortModel | ( | QObject * | parent = Q_NULLPTR | ) |

Constructs a ProfileSortModel with no active text filter and AllProfiles visibility.

Parameters

  parent | Optional parent QObject.

## Member Function Documentation

## ◆ filterAcceptsRow()

bool ProfileSortModel::filterAcceptsRow | ( | int | source_row,
|  | const QModelIndex & | source_parent ) const
| override protected virtual

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
| override protected virtual

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