QGIS API Documentation
3.6.0-Noosa (5873452)
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 "
qgsvectorlayerfeatureiterator.h
"
19
#include "
qgsrenderer.h
"
20
#include "
qgstaskmanager.h
"
21
32
class
CORE_EXPORT
QgsVectorLayerFeatureCounter
:
public
QgsTask
33
{
34
Q_OBJECT
35
36
public
:
37
41
QgsVectorLayerFeatureCounter
(
QgsVectorLayer
*layer,
const
QgsExpressionContext
&context =
QgsExpressionContext
() );
42
43
bool
run
()
override
;
44
51
QHash<QString, long> symbolFeatureCountMap()
const
SIP_SKIP
;
52
57
long
featureCount(
const
QString &legendKey )
const
;
58
59
signals:
60
64
void
symbolsCounted();
65
66
private
:
67
std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
68
std::unique_ptr<QgsFeatureRenderer> mRenderer;
69
QgsExpressionContext
mExpressionContext;
70
QHash<QString, long> mSymbolFeatureCountMap;
71
int
mFeatureCount;
72
73
};
74
75
#endif // QGSVECTORLAYERFEATURECOUNTER_H
QgsVectorLayerFeatureCounter
Counts the features in a QgsVectorLayer in task.
Definition:
qgsvectorlayerfeaturecounter.h:32
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:371
QgsTask
Abstract base class for long running background tasks.
Definition:
qgstaskmanager.h:52
qgsvectorlayerfeatureiterator.h
qgsrenderer.h
QgsTask::run
virtual bool run()=0
Performs the task's operation.
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:362
qgstaskmanager.h
Generated on Sat Feb 23 2019 03:59:22 for QGIS API Documentation by
1.8.13