QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Public Member Functions | List of all members
QgsFeatureFilter Class Reference

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

#include <qgsfeaturefilter.h>

Inheritance diagram for QgsFeatureFilter:
Inheritance graph
[legend]

Public Member Functions

 QgsFeatureFilter ()=default
 Constructor. More...
 
QgsFeatureFilterProviderclone () const override
 Returns a clone of the object. More...
 
void filterFeatures (const QgsVectorLayer *layer, QgsFeatureRequest &filterFeatures) const override
 Filter the features of the layer. More...
 
QStringList layerAttributes (const QgsVectorLayer *layer, const QStringList &attributes) const override
 Returns the list of visible attribute names from a list of attributes names for the given layer. More...
 
void setFilter (const QgsVectorLayer *layer, const QgsExpression &expression)
 Set a filter for the given layer. More...
 
- Public Member Functions inherited from QgsFeatureFilterProvider
 QgsFeatureFilterProvider ()=default
 Constructor. More...
 
virtual ~QgsFeatureFilterProvider ()=default
 

Detailed Description

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

Since
QGIS 3.0

Definition at line 34 of file qgsfeaturefilter.h.

Constructor & Destructor Documentation

◆ QgsFeatureFilter()

QgsFeatureFilter::QgsFeatureFilter ( )
default

Constructor.

Member Function Documentation

◆ clone()

QgsFeatureFilterProvider * QgsFeatureFilter::clone ( ) const
overridevirtual

Returns a clone of the object.

Returns
A clone

Implements QgsFeatureFilterProvider.

Definition at line 38 of file qgsfeaturefilter.cpp.

◆ filterFeatures()

void QgsFeatureFilter::filterFeatures ( const QgsVectorLayer layer,
QgsFeatureRequest filterFeatures 
) const
overridevirtual

Filter the features of the layer.

Parameters
layerthe layer to control
filterFeaturesthe request to fill

Implements QgsFeatureFilterProvider.

Definition at line 23 of file qgsfeaturefilter.cpp.

◆ layerAttributes()

QStringList QgsFeatureFilter::layerAttributes ( const QgsVectorLayer layer,
const QStringList &  attributes 
) const
overridevirtual

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

Since
QGIS 3.18

Implements QgsFeatureFilterProvider.

Definition at line 32 of file qgsfeaturefilter.cpp.

◆ setFilter()

void QgsFeatureFilter::setFilter ( const QgsVectorLayer layer,
const QgsExpression expression 
)

Set a filter for the given layer.

Parameters
layerthe layer to filter
expressionthe filter expression

Definition at line 45 of file qgsfeaturefilter.cpp.


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