Wireshark 4.7.0
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
 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.
 

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

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
parentOptional parent QObject.

Member Function Documentation

◆ 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_rowRow index in the source model.
source_parentParent 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_leftIndex of the left-hand item in the source model.
source_rightIndex 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
txtFilter string; pass an empty string to clear the filter.

◆ setFilterType()

void ProfileSortModel::setFilterType ( FilterType  ft)

Sets the profile-scope filter.

Parameters
ftThe FilterType to apply.

The documentation for this class was generated from the following files: