InactiveFilterProxyModel Class Reference

A simple filtering model that shows only data marked "active" in the underlying model or otherwise marked as acceptable for viewing. More...

#include <aiselectorprivate.h>

Public Member Functions

 InactiveFilterProxyModel (QObject *pParent=0)
 
virtual QVariant data (const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
 Return filtered data from the underlying model, with visual roles augmented for inactive rows.
 

Public Attributes

QList< int > allowedIds
 

Protected Member Functions

virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 Show the row if it's active or someone told us it's OK to show it.
 
virtual bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
 

Detailed Description

A simple filtering model that shows only data marked "active" in the underlying model or otherwise marked as acceptable for viewing.

This filter does not impose a sort order on the data. The inactive records are shown mingled with the active ones to simplify finding them in long completer lists. The inactive records are formatted to distinguish them from active ones.

See also
InactiveFilterProxyModel::data

Constructor & Destructor Documentation

◆ InactiveFilterProxyModel()

InactiveFilterProxyModel::InactiveFilterProxyModel ( QObject * pParent = 0)

Member Function Documentation

◆ data()

QVariant InactiveFilterProxyModel::data ( const QModelIndex & pIndex,
int pRole = Qt::DisplayRole ) const
overridevirtual

Return filtered data from the underlying model, with visual roles augmented for inactive rows.

Inactive rows are displayed specially with an icon, the "expired" color from the current user's locale, and strikethrough text.

◆ filterAcceptsRow()

bool InactiveFilterProxyModel::filterAcceptsRow ( int sourceRow,
const QModelIndex & sourceParent ) const
overrideprotectedvirtual

Show the row if it's active or someone told us it's OK to show it.

The allowedIds list contains the internal ids of rows someone told us should be visible. A list allows for more complex uses cases with little added code complexity.

◆ lessThan()

bool InactiveFilterProxyModel::lessThan ( const QModelIndex & left,
const QModelIndex & right ) const
overrideprotectedvirtual

Member Data Documentation

◆ allowedIds

QList<int> InactiveFilterProxyModel::allowedIds

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

Generated on Mon Feb 17 2025 xTuple ERP Programmer Reference, Version 6.2.0 doxygen 1.11.0