A proxy model that provides custom sorting and filtering for the list of interfaces.
More...
#include <interface_sort_filter_model.h>
|
| | InterfaceSortFilterModel (QObject *parent) |
| | Constructs a new InterfaceSortFilterModel.
|
| |
| void | setStoreOnChange (bool storeOnChange) |
| | Configures whether changes to interface visibility state should be stored persistently.
|
| |
|
void | resetAllFilter () |
| | Resets all current filters to their default states.
|
| |
| void | setFilterHidden (bool filter) |
| | Sets whether hidden interfaces should be filtered out (not displayed).
|
| |
| bool | filterHidden () const |
| | Checks if hidden interfaces are currently being filtered out.
|
| |
| int | interfacesHidden () |
| | Gets the count of interfaces that are currently hidden by the filter.
|
| |
|
void | toggleFilterHidden () |
| | Toggles the filter state for hidden interfaces.
|
| |
| void | setSortByActivity (bool sort) |
| | Sets whether the interfaces should be dynamically sorted based on network activity.
|
| |
| bool | sortByActivity () const |
| | Checks if the interfaces are currently being sorted by activity.
|
| |
| void | setInterfaceTypeVisible (int ifType, bool visible) |
| | Sets the visibility for a specific interface type.
|
| |
| bool | isInterfaceTypeShown (int ifType) const |
| | Checks if a specific interface type is currently set to be visible.
|
| |
| void | setFilterByType (bool filter, bool invert=false) |
| | Enables or disables filtering by interface type.
|
| |
| bool | filterByType () const |
| | Checks if filtering by interface type is currently active.
|
| |
| void | toggleTypeVisibility (int ifType) |
| | Toggles the visibility state for a specific interface type.
|
| |
| QList< int > | typesDisplayed () |
| | Retrieves a list of interface types that are currently set to be displayed.
|
| |
| void | setColumns (QList< InterfaceTreeColumns > columns) |
| | Configures which specific columns from the source model should be displayed.
|
| |
| int | mapSourceToColumn (InterfaceTreeColumns mdlIndex) |
| | Maps a logical column identifier to its actual display column index.
|
| |
| QModelIndex | mapToSource (const QModelIndex &proxyIndex) const |
| | Maps a proxy model index to its corresponding source model index.
|
| |
| QModelIndex | mapFromSource (const QModelIndex &sourceIndex) const |
| | Maps a source model index to its corresponding proxy model index.
|
| |
| QString | interfaceError () |
| | Retrieves any current interface-related error messages.
|
| |
|
| bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const |
| | Determines whether a row from the source model matches all active filters.
|
| |
| bool | filterAcceptsColumn (int source_column, const QModelIndex &source_parent) const |
| | Determines whether a column from the source model matches active column filters.
|
| |
| bool | lessThan (const QModelIndex &source_left, const QModelIndex &source_right) const |
| | Compares two source indices to determine their sort order.
|
| |
A proxy model that provides custom sorting and filtering for the list of interfaces.
◆ InterfaceSortFilterModel()
| InterfaceSortFilterModel::InterfaceSortFilterModel |
( |
QObject * |
parent | ) |
|
◆ filterAcceptsColumn()
| bool InterfaceSortFilterModel::filterAcceptsColumn |
( |
int |
source_column, |
|
|
const QModelIndex & |
source_parent |
|
) |
| const |
|
protected |
Determines whether a column from the source model matches active column filters.
- Parameters
-
| source_column | The column index in the source model. |
| source_parent | The parent index in the source model. |
- Returns
- True if the column should be displayed, false otherwise.
◆ filterAcceptsRow()
| bool InterfaceSortFilterModel::filterAcceptsRow |
( |
int |
source_row, |
|
|
const QModelIndex & |
source_parent |
|
) |
| const |
|
protected |
Determines whether a row from the source model matches all active filters.
- Parameters
-
| source_row | The row index in the source model. |
| source_parent | The parent index in the source model. |
- Returns
- True if the row should be displayed, false otherwise.
◆ filterByType()
| bool InterfaceSortFilterModel::filterByType |
( |
| ) |
const |
Checks if filtering by interface type is currently active.
- Returns
- True if type filtering is active, false otherwise.
◆ filterHidden()
| bool InterfaceSortFilterModel::filterHidden |
( |
| ) |
const |
Checks if hidden interfaces are currently being filtered out.
- Returns
- True if filtering hidden interfaces, false otherwise.
◆ interfaceError()
| QString InterfaceSortFilterModel::interfaceError |
( |
| ) |
|
Retrieves any current interface-related error messages.
- Returns
- The error message string, or empty if no errors.
◆ interfacesHidden()
| int InterfaceSortFilterModel::interfacesHidden |
( |
| ) |
|
Gets the count of interfaces that are currently hidden by the filter.
- Returns
- The number of hidden interfaces.
◆ isInterfaceTypeShown()
| bool InterfaceSortFilterModel::isInterfaceTypeShown |
( |
int |
ifType | ) |
const |
Checks if a specific interface type is currently set to be visible.
- Parameters
-
| ifType | The interface type identifier. |
- Returns
- True if visible, false otherwise.
◆ lessThan()
| bool InterfaceSortFilterModel::lessThan |
( |
const QModelIndex & |
source_left, |
|
|
const QModelIndex & |
source_right |
|
) |
| const |
|
protected |
Compares two source indices to determine their sort order.
- Parameters
-
| source_left | The first source index. |
| source_right | The second source index. |
- Returns
- True if the left item should appear before the right item.
◆ mapFromSource()
| QModelIndex InterfaceSortFilterModel::mapFromSource |
( |
const QModelIndex & |
sourceIndex | ) |
const |
Maps a source model index to its corresponding proxy model index.
- Parameters
-
| sourceIndex | The source model index. |
- Returns
- The proxy model index.
◆ mapSourceToColumn()
Maps a logical column identifier to its actual display column index.
- Parameters
-
| mdlIndex | The logical column identifier. |
- Returns
- The display column index, or -1 if not found.
◆ mapToSource()
| QModelIndex InterfaceSortFilterModel::mapToSource |
( |
const QModelIndex & |
proxyIndex | ) |
const |
Maps a proxy model index to its corresponding source model index.
- Parameters
-
| proxyIndex | The proxy model index. |
- Returns
- The source model index.
◆ setColumns()
Configures which specific columns from the source model should be displayed.
- Parameters
-
| columns | A list of InterfaceTreeColumns to show. |
◆ setFilterByType()
| void InterfaceSortFilterModel::setFilterByType |
( |
bool |
filter, |
|
|
bool |
invert = false |
|
) |
| |
Enables or disables filtering by interface type.
- Parameters
-
| filter | True to apply type filtering, false to ignore type visibility settings. |
| invert | True to invert the logic (show what is usually hidden, hide what is usually shown). |
◆ setFilterHidden()
| void InterfaceSortFilterModel::setFilterHidden |
( |
bool |
filter | ) |
|
Sets whether hidden interfaces should be filtered out (not displayed).
- Parameters
-
| filter | True to hide interfaces marked as hidden, false to show them. |
◆ setInterfaceTypeVisible()
| void InterfaceSortFilterModel::setInterfaceTypeVisible |
( |
int |
ifType, |
|
|
bool |
visible |
|
) |
| |
Sets the visibility for a specific interface type.
- Parameters
-
| ifType | The interface type identifier. |
| visible | True to make this type visible, false to hide it. |
◆ setSortByActivity()
| void InterfaceSortFilterModel::setSortByActivity |
( |
bool |
sort | ) |
|
Sets whether the interfaces should be dynamically sorted based on network activity.
- Parameters
-
| sort | True to sort by activity, false to use standard sorting. |
◆ setStoreOnChange()
| void InterfaceSortFilterModel::setStoreOnChange |
( |
bool |
storeOnChange | ) |
|
Configures whether changes to interface visibility state should be stored persistently.
- Parameters
-
| storeOnChange | True to store changes automatically, false otherwise. |
◆ sortByActivity()
| bool InterfaceSortFilterModel::sortByActivity |
( |
| ) |
const |
Checks if the interfaces are currently being sorted by activity.
- Returns
- True if sorting by activity, false otherwise.
◆ toggleTypeVisibility()
| void InterfaceSortFilterModel::toggleTypeVisibility |
( |
int |
ifType | ) |
|
Toggles the visibility state for a specific interface type.
- Parameters
-
| ifType | The interface type identifier. |
◆ typesDisplayed()
| QList< int > InterfaceSortFilterModel::typesDisplayed |
( |
| ) |
|
Retrieves a list of interface types that are currently set to be displayed.
- Returns
- A list of integer type identifiers.
The documentation for this class was generated from the following files: