# eric7.EricCore.EricTreeSortFilterProxyModel

Module implementing a modified QSortFilterProxyModel.

### Global Attributes

None

### Classes

EricTreeSortFilterProxyModel | Class implementing a modified QSortFilterProxyModel.

### Functions

None

## EricTreeSortFilterProxyModel

Class implementing a modified QSortFilterProxyModel.

It always accepts the root nodes in the tree so filtering is only done on the children.

### Derived from

QSortFilterProxyModel

### Class Attributes

None

### Class Methods

None

### Methods

EricTreeSortFilterProxyModel | Constructor
filterAcceptsRow | Public method to determine, if the row is acceptable.
hasChildren | Public method to check, if a parent node has some children.

### Static Methods

None

#### EricTreeSortFilterProxyModel (Constructor)

EricTreeSortFilterProxyModel(parent=None)

Constructor

parent
  reference to the parent object (QObject)

#### EricTreeSortFilterProxyModel.filterAcceptsRow

filterAcceptsRow(sourceRow, sourceParent)

Public method to determine, if the row is acceptable.

sourceRow
  row number in the source model (integer)
sourceParent
  index of the source item (QModelIndex)

Return:
  flag indicating acceptance (boolean)

#### EricTreeSortFilterProxyModel.hasChildren

hasChildren(parent=None)

Public method to check, if a parent node has some children.

parent
  index of the parent node (QModelIndex)

Return:
  flag indicating the presence of children (boolean)

Up