Class: QgsFeatureFilterProvider¶
- class qgis.core.QgsFeatureFilterProvider¶
Bases:
sip.wrapper
Abstract interface for use by classes that filter the features or attributes of a layer.
A
QgsFeatureFilterProvider
provides a method for modifying aQgsFeatureRequest
in place to apply additional filters to the request, since QGIS 3.18 a method to filter allowed attributes is also available.Methods
Create a clone of the feature filter provider
Add additional filters to the feature request to further restrict the features returned by the request.
Returns the list of visible attribute names from a list of
attributes
names for the givenlayer
- clone(self) QgsFeatureFilterProvider | None ¶
Create a clone of the feature filter provider
- Return type:
Optional[QgsFeatureFilterProvider]
- Returns:
a new clone
- filterFeatures(self, layer: QgsVectorLayer | None, featureRequest: QgsFeatureRequest)¶
Add additional filters to the feature request to further restrict the features returned by the request. Derived classes must implement this method.
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to filter
featureRequest (QgsFeatureRequest) – the feature request to update
- layerAttributes(self, layer: QgsVectorLayer | None, attributes: Iterable[str | None]) List[str] ¶
Returns the list of visible attribute names from a list of
attributes
names for the givenlayer
Added in version 3.18.
- Parameters:
layer (Optional[QgsVectorLayer])
attributes (Iterable[Optional[str]])
- Return type:
List[str]