Class: QgsFeatureFilterProvider

Abstract interface for use by classes that filter the features or attributes of a layer.

A QgsFeatureFilterProvider provides a method for modifying a QgsFeatureRequest in place to apply additional filters to the request, since QGIS 3.18 a method to filter allowed attributes is also available.

Class Hierarchy

Inheritance diagram of qgis.core.QgsFeatureFilterProvider

Subclasses

QgsAccessControl

A helper class that centralizes restrictions given by all the access control filter plugins.

QgsFeatureFilter

A feature filter provider allowing to set filter expressions on a per-layer basis.

QgsFeatureFilterProviderGroup

A filter filter provider grouping several filter providers.

class qgis.core.QgsFeatureFilterProvider[source]

Bases: object

clone(self) QgsFeatureFilterProvider | None[source]

Create a clone of the feature filter provider

Return type:

Optional[QgsFeatureFilterProvider]

Returns:

a new clone

filterFeatures(self, layer: QgsVectorLayer | None, featureRequest: QgsFeatureRequest)[source]

Add additional filters to the feature request to further restrict the features returned by the request. Derived classes must implement this method.

Parameters:
layerAttributes(self, layer: QgsVectorLayer | None, attributes: Iterable[str | None]) List[str][source]

Returns the list of visible attribute names from a list of attributes names for the given layer

Added in version 3.18.

Parameters:
  • layer (Optional[QgsVectorLayer])

  • attributes (Iterable[Optional[str]])

Return type:

List[str]