Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Public Types | Public Slots | Public Member Functions | List of all members
AStringListListSortFilterProxyModel Class Reference

A sort/filter proxy model for AStringListList-based models. More...

#include <astringlist_list_model.h>

Inheritance diagram for AStringListListSortFilterProxyModel:

Public Types

enum  AStringListListFilterType { FilterByContains = 0 , FilterByStart , FilterByEquivalent , FilterNone }
 Text filter match mode applied to a column. More...
 

Public Slots

void setFilter (const QString &filter)
 Set the filter string and trigger re-evaluation of visible rows.
 

Public Member Functions

 AStringListListSortFilterProxyModel (QObject *parent=Q_NULLPTR)
 Construct an AStringListListSortFilterProxyModel.
 
virtual bool lessThan (const QModelIndex &left, const QModelIndex &right) const
 Compare two rows for sorting.
 
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const
 Determine whether a source row passes the current filter.
 
virtual bool filterAcceptsColumn (int column, const QModelIndex &sourceParent) const
 Determine whether a source column should be visible.
 
void setFilterType (AStringListListFilterType type, int column=-1)
 Set the filter match mode for a column.
 
void setColumnToFilter (int column)
 Set a single column to include in filter evaluation.
 
void setColumnsToFilter (QList< int > columns)
 Set multiple columns to include in filter evaluation.
 
void clearColumnsToFilter ()
 Clear the list of columns included in filter evaluation.
 
void clearHiddenColumns ()
 Clear the list of hidden columns, making all columns visible.
 
void setColumnToHide (int col)
 Hide a column from the view.
 
void clearNumericColumns ()
 Clear the list of numeric columns, reverting all to string sort.
 
void setColumnAsNumeric (int col)
 Mark a column for numeric rather than lexicographic sorting.
 

Detailed Description

A sort/filter proxy model for AStringListList-based models.

Member Enumeration Documentation

◆ AStringListListFilterType

Text filter match mode applied to a column.

Enumerator
FilterByContains 

Row is accepted if the column value contains the filter string.

FilterByStart 

Row is accepted if the column value starts with the filter string.

FilterByEquivalent 

Row is accepted if the column value equals the filter string.

FilterNone 

No filtering is applied to this column.

Constructor & Destructor Documentation

◆ AStringListListSortFilterProxyModel()

AStringListListSortFilterProxyModel::AStringListListSortFilterProxyModel ( QObject *  parent = Q_NULLPTR)
explicit

Construct an AStringListListSortFilterProxyModel.

Parameters
parentThe parent QObject.

Member Function Documentation

◆ filterAcceptsColumn()

bool AStringListListSortFilterProxyModel::filterAcceptsColumn ( int  column,
const QModelIndex &  sourceParent 
) const
virtual

Determine whether a source column should be visible.

Parameters
columnColumn index in the source model.
sourceParentParent index in the source model (unused).
Returns
true if the column should be shown; false if it is hidden.

◆ filterAcceptsRow()

bool AStringListListSortFilterProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
virtual

Determine whether a source row passes the current filter.

Parameters
sourceRowRow index in the source model.
sourceParentParent index in the source model.
Returns
true if the row should be shown.

◆ lessThan()

bool AStringListListSortFilterProxyModel::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
virtual

Compare two rows for sorting.

Parameters
leftSource model index of the left-hand item.
rightSource model index of the right-hand item.
Returns
true if left should sort before right.

◆ setColumnAsNumeric()

void AStringListListSortFilterProxyModel::setColumnAsNumeric ( int  col)

Mark a column for numeric rather than lexicographic sorting.

Parameters
colThe column index to treat as numeric.

◆ setColumnsToFilter()

void AStringListListSortFilterProxyModel::setColumnsToFilter ( QList< int >  columns)

Set multiple columns to include in filter evaluation.

Parameters
columnsThe list of column indices to filter on.

◆ setColumnToFilter()

void AStringListListSortFilterProxyModel::setColumnToFilter ( int  column)

Set a single column to include in filter evaluation.

Parameters
columnThe column index to filter on.

◆ setColumnToHide()

void AStringListListSortFilterProxyModel::setColumnToHide ( int  col)

Hide a column from the view.

Parameters
colThe column index to hide.

◆ setFilter

void AStringListListSortFilterProxyModel::setFilter ( const QString &  filter)
slot

Set the filter string and trigger re-evaluation of visible rows.

Parameters
filterThe text to filter on; an empty string shows all rows.

◆ setFilterType()

void AStringListListSortFilterProxyModel::setFilterType ( AStringListListFilterType  type,
int  column = -1 
)

Set the filter match mode for a column.

Parameters
typeThe match mode to apply.
columnThe column to configure, or -1 to apply type to all columns in columnsToFilter_.

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