QGIS API Documentation
3.14.0-Pi (9f7028fd23)
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
#include "
qgsfeatureid.h
"
22
33
class
CORE_EXPORT
QgsVectorLayerFeatureCounter
:
public
QgsTask
34
{
35
Q_OBJECT
36
37
public
:
38
45
QgsVectorLayerFeatureCounter
(
QgsVectorLayer
*layer,
const
QgsExpressionContext
&context =
QgsExpressionContext
(),
bool
storeSymbolFids =
false
);
46
47
51
bool
run
()
override
;
52
59
QHash<QString, long> symbolFeatureCountMap()
const
SIP_SKIP
;
60
65
long
featureCount(
const
QString &legendKey )
const
;
66
75
QHash<QString, QgsFeatureIds> symbolFeatureIdMap()
const
SIP_SKIP
;
76
83
QgsFeatureIds
featureIds(
const
QString &symbolkey )
const
;
84
85
signals:
86
90
void
symbolsCounted();
91
92
private
:
93
std::unique_ptr<QgsVectorLayerFeatureSource> mSource;
94
std::unique_ptr<QgsFeatureRenderer> mRenderer;
95
QgsExpressionContext
mExpressionContext;
96
QHash<QString, long> mSymbolFeatureCountMap;
97
QHash<QString, QgsFeatureIds> mSymbolFeatureIdMap;
98
bool
mWithFids =
false
;
99
int
mFeatureCount;
100
101
};
102
103
#endif // QGSVECTORLAYERFEATURECOUNTER_H
QgsVectorLayerFeatureCounter
Definition:
qgsvectorlayerfeaturecounter.h:33
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition:
qgsexpressioncontext.h:369
qgstaskmanager.h
qgsfeatureid.h
SIP_SKIP
#define SIP_SKIP
Definition:
qgis_sip.h:126
qgsvectorlayerfeatureiterator.h
qgsrenderer.h
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition:
qgsfeatureid.h:34
QgsVectorLayer
Definition:
qgsvectorlayer.h:385
QgsTask::run
virtual bool run()=0
Performs the task's operation.
QgsTask
Abstract base class for long running background tasks. Tasks can be controlled directly,...
Definition:
qgstaskmanager.h:52
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17