QGIS API Documentation
3.0.2-Girona (307d082)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
w
z
+
Functions
a
b
c
d
f
g
i
l
n
o
p
r
s
t
u
z
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
a
b
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
x
y
z
+
Related Functions
a
c
d
e
f
g
l
m
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
u
v
w
z
+
Variables
a
d
g
h
i
l
n
p
u
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
qgsvectorlayerfeaturecounter.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsvectorlayerfeaturecounter.h
3
---------------------
4
begin : May 2017
5
copyright : (C) 2017 by Matthias Kuhn
6
email : matthias at opengis dot ch
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
#ifndef QGSVECTORLAYERFEATURECOUNTER_H
16
#define QGSVECTORLAYERFEATURECOUNTER_H
17
18
#include "
qgsvectorlayer.h
"
19
#include "
qgsvectorlayerfeatureiterator.h
"
20
#include "
qgsrenderer.h
"
21
#include "
qgstaskmanager.h
"
22
33
class
CORE_EXPORT
QgsVectorLayerFeatureCounter
:
public
QgsTask
34
{
35
Q_OBJECT
36
37
public
:
38
42
QgsVectorLayerFeatureCounter
(
QgsVectorLayer
*layer,
const
QgsExpressionContext
&context =
QgsExpressionContext
() );
43
44
bool
run
()
override
;
45
52
QHash<QString, long> symbolFeatureCountMap()
const
SIP_SKIP
;
53
58
long
featureCount(
const
QString &legendKey )
const
;
59
60
signals:
61
65
void
symbolsCounted();
66
67
private
:
68
std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
69
std::unique_ptr<QgsFeatureRenderer> mRenderer;
70
QgsExpressionContext
mExpressionContext;
71
QHash<QString, long> mSymbolFeatureCountMap;
72
int
mFeatureCount;
73
74
};
75
76
#endif // QGSVECTORLAYERFEATURECOUNTER_H
QgsVectorLayerFeatureCounter
Counts the features in a QgsVectorLayer in task.
Definition:
qgsvectorlayerfeaturecounter.h:33
SIP_SKIP
#define SIP_SKIP
Definition:
qgis_sip.h:119
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition:
qgsexpressioncontext.h:375
QgsTask
Abstract base class for long running background tasks.
Definition:
qgstaskmanager.h:53
qgsvectorlayerfeatureiterator.h
qgsrenderer.h
QgsTask::run
virtual bool run()=0
Performs the task's operation.
qgsvectorlayer.h
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:353
qgstaskmanager.h
Generated on Sat Apr 21 2018 11:45:00 for QGIS API Documentation by
1.8.13