Applies per column filtering to PySide.QtGui.QSortFilterProxyModel.
This behaves almost exactly the same as PySide.QtGui.QSortFilterProxyModel, but allows separate filters for each column. Also, the filters are callables which take a value and return True (show) or False (hide).
This class inherits from HideProxyMixin, and provides all the expected mapping functions.
Return the filter function and role as set by setFilterFunction.
The return value is a tuple of (function, role). If no filter has been set, both values are None.
Assign a filter function to a column.
role sets which role is used for obtaining the values passed to func. For example, to hide all rows with a red background in the second column:
def filter_function(value):
if isinstance(value, QBrush):
return value.color() != qte.QColor(QColor.red)
else:
return True
proxy.setFilterFunction(1, filter_function, qte.Qt.BackgroundRole)
See also
See also
See also
See also