ComponentSortFilterProxyModel Class | Qt Installer Framework Manual

- Qt Installer Framework Manual
- ComponentSortFilterProxyModel

# ComponentSortFilterProxyModel Class

class QInstaller::ComponentSortFilterProxyModel

The ComponentSortFilterProxyModel provides support for sorting and filtering data passed between another model and a view. More...

Header: | #include <ComponentSortFilterProxyModel>

- List of all members, including inherited members

## Public Types

enum | AcceptType { Direct, Descendant, Rejected }

## Public Functions

| ComponentSortFilterProxyModel(QObject *parent = nullptr)
QVector<QModelIndex> | directlyAcceptedIndexes() const

## Reimplemented Protected Functions

virtual bool | filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override

## Detailed Description

The class subclasses QSortFilterProxyModel. Compared to the base class, filters affect also child indexes in the base model, meaning if a certain row has a parent that is accepted by filter, it is also accepted. A distinction is made betweed directly and indirectly accepted indexes.

## Member Type Documentation

### enum ComponentSortFilterProxyModel::AcceptType

This enum holds the possible values for filter acception type for model indexes.

Constant | Value | Description
--- | --- | ---
`QInstaller::ComponentSortFilterProxyModel::Direct` | `0` | Index was accepted directly by filter.
`QInstaller::ComponentSortFilterProxyModel::Descendant` | `1` | Index is a descendant of an accepted index.
`QInstaller::ComponentSortFilterProxyModel::Rejected` | `2` | Index was not accepted by filter.

## Member Function Documentation

### `[explicit]` ComponentSortFilterProxyModel::ComponentSortFilterProxyModel(QObject *parent = nullptr)

Constructs object with parent.

### QVector<QModelIndex> ComponentSortFilterProxyModel::directlyAcceptedIndexes() const

Returns a list of source model indexes that were accepted directly by the filter.

### `[override virtual protected]` bool ComponentSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const

Returns `true` if the item in the row indicated by the given sourceRow and sourceParent should be included in the model; otherwise returns `false`.