QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
qgsfeaturefiltermodel.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeaturefiltermodel.h - QgsFeatureFilterModel
3 ---------------------
4 begin : 10.3.2017
5 copyright : (C) 2017 by Matthias Kuhn
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 QGSFEATUREFILTERMODEL_H
16#define QGSFEATUREFILTERMODEL_H
17
18
20
28{
29 Q_OBJECT
30
36 Q_PROPERTY( QStringList identifierFields READ identifierFields WRITE setIdentifierFields NOTIFY identifierFieldsChanged )
37
38
41 Q_PROPERTY( QVariantList extraIdentifierValues READ extraIdentifierValues WRITE setExtraIdentifierValues NOTIFY extraIdentifierValuesChanged )
42
43 public:
44
48 explicit QgsFeatureFilterModel( QObject *parent = nullptr );
49
56 Q_DECL_DEPRECATED QString identifierField() const;
57
63 QStringList identifierFields() const;
64
71 void setIdentifierFields( const QStringList &identifierFields );
72
78 void setExtraIdentifierValueToNull() override;
79
85 QVariantList extraIdentifierValues() const;
86
92 void setExtraIdentifierValues( const QVariantList &extraIdentifierValues );
93
94
95 signals:
96
101 void identifierFieldsChanged();
102
107 void extraIdentifierValuesChanged();
108
109 private:
110 QgsFeatureExpressionValuesGatherer *createValuesGatherer( const QgsFeatureRequest &request ) const override;
111
112 void requestToReloadCurrentFeature( QgsFeatureRequest &request ) override SIP_FORCE;
113
114 QSet<QString> requestedAttributes() const override;
115
116 QVariant entryIdentifier( const QgsFeatureExpressionValuesGatherer::Entry &entry ) const override;
117
118 QgsFeatureExpressionValuesGatherer::Entry createEntry( const QVariant &identifier ) const override;
119
120 bool compareEntries( const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b ) const override;
121
122 bool identifierIsNull( const QVariant &identifier ) const override;
123
124 QVariant nullIdentifier() const override;
125
126 QStringList mIdentifierFields;
127};
128
129#endif // QGSFEATUREFILTERMODEL_H
Provides a list of features based on filter conditions.
Provides a list of features based on filter conditions.
This class wraps a request for features to a vector layer (or directly its vector data provider).
#define SIP_FORCE
Definition qgis_sip.h:131