QGIS API Documentation
3.14.0-Pi (9f7028fd23)
src
server
qgsfeaturefilterprovidergroup.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsfeaturefilterprovidergroup.cpp
3
--------------------------------
4
begin : 26-10-2017
5
copyright : (C) 2017 by Patrick Valsecchi
6
email : patrick dot valsecchi at camptocamp dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#include "
qgsfeaturefilterprovidergroup.h
"
19
#include "
qgsfeaturerequest.h
"
20
21
void
QgsFeatureFilterProviderGroup::filterFeatures
(
const
QgsVectorLayer
*layer,
QgsFeatureRequest
&filterFeatures )
const
22
{
23
filterFeatures
.disableFilter();
24
for
(
const
QgsFeatureFilterProvider
*provider : mProviders )
25
{
26
QgsFeatureRequest
temp;
27
provider->filterFeatures( layer, temp );
28
if
( temp.
filterExpression
() )
29
{
30
filterFeatures
.combineFilterExpression( temp.
filterExpression
()->
dump
() );
31
}
32
}
33
}
34
35
QgsFeatureFilterProvider
*
QgsFeatureFilterProviderGroup::clone
()
const
36
{
37
auto
result =
new
QgsFeatureFilterProviderGroup
();
38
result->mProviders = mProviders;
39
return
result;
40
}
41
42
QgsFeatureFilterProviderGroup
&
QgsFeatureFilterProviderGroup::addProvider
(
const
QgsFeatureFilterProvider
*provider )
43
{
44
if
( provider )
45
{
46
mProviders.append( provider );
47
}
48
return
*
this
;
49
}
qgsfeaturerequest.h
QgsExpression::dump
QString dump() const
Returns an expression string, constructed from the internal abstract syntax tree.
Definition:
qgsexpression.cpp:389
QgsFeatureFilterProviderGroup::clone
QgsFeatureFilterProvider * clone() const override
Returns a clone of the object.
Definition:
qgsfeaturefilterprovidergroup.cpp:35
QgsFeatureFilterProviderGroup
A filter filter provider grouping several filter providers.
Definition:
qgsfeaturefilterprovidergroup.h:32
QgsFeatureFilterProviderGroup::QgsFeatureFilterProviderGroup
QgsFeatureFilterProviderGroup()=default
Constructor.
QgsFeatureFilterProviderGroup::filterFeatures
void filterFeatures(const QgsVectorLayer *layer, QgsFeatureRequest &filterFeatures) const override
Filter the features of the layer.
Definition:
qgsfeaturefilterprovidergroup.cpp:21
qgsfeaturefilterprovidergroup.h
QgsFeatureRequest
Definition:
qgsfeaturerequest.h:75
QgsFeatureRequest::filterExpression
QgsExpression * filterExpression() const
Returns the filter expression if set.
Definition:
qgsfeaturerequest.h:425
QgsVectorLayer
Definition:
qgsvectorlayer.h:385
QgsFeatureFilterProvider
Definition:
qgsfeaturefilterprovider.h:40
QgsFeatureFilterProviderGroup::addProvider
QgsFeatureFilterProviderGroup & addProvider(const QgsFeatureFilterProvider *provider)
Add another filter provider to the group.
Definition:
qgsfeaturefilterprovidergroup.cpp:42
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17