QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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
6  email : [email protected]
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 
29 {
30  Q_OBJECT
31 
37  Q_PROPERTY( QStringList identifierFields READ identifierFields WRITE setIdentifierFields NOTIFY identifierFieldsChanged )
38 
39 
42  Q_PROPERTY( QVariantList extraIdentifierValues READ extraIdentifierValues WRITE setExtraIdentifierValues NOTIFY extraIdentifierValuesChanged )
43 
44  public:
45 
49  explicit QgsFeatureFilterModel( QObject *parent = nullptr );
50 
57  Q_DECL_DEPRECATED QString identifierField() const;
58 
64  QStringList identifierFields() const;
65 
72  void setIdentifierFields( const QStringList &identifierFields );
73 
79  void setExtraIdentifierValueToNull() override;
80 
86  QVariantList extraIdentifierValues() const;
87 
93  void setExtraIdentifierValues( const QVariantList &extraIdentifierValues );
94 
95 
96  signals:
97 
102  void identifierFieldsChanged();
103 
108  void extraIdentifierValuesChanged();
109 
110  private:
111  QgsFeatureExpressionValuesGatherer *createValuesGatherer( const QgsFeatureRequest &request ) const override;
112 
114 
115  QSet<QString> requestedAttributes() const override;
116 
117  QVariant entryIdentifier( const QgsFeatureExpressionValuesGatherer::Entry &entry ) const override;
118 
119  QgsFeatureExpressionValuesGatherer::Entry createEntry( const QVariant &identifier ) const override;
120 
121  bool compareEntries( const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b ) const override;
122 
123  bool identifierIsNull( const QVariant &identifier ) const override;
124 
125  QVariant nullIdentifier() const override;
126 
127  QStringList mIdentifierFields;
128 };
129 
130 #endif // QGSFEATUREFILTERMODEL_H
QgsFeaturePickerModelBase::nullIdentifier
virtual QVariant nullIdentifier() const =0
Returns a null identifier.
QgsFeaturePickerModelBase::compareEntries
virtual bool compareEntries(const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b) const =0
Returns true if the 2 entries refers to the same feature.
qgsfeaturepickermodelbase.h
QgsFeaturePickerModelBase
Provides a list of features based on filter conditions.
Definition: qgsfeaturepickermodelbase.h:32
QgsFeaturePickerModelBase::identifierIsNull
virtual bool identifierIsNull(const QVariant &identifier) const =0
Returns true if the entry is null The identifier can be either the feature ID or the list of identifi...
QgsFeatureFilterModel
Provides a list of features based on filter conditions. Features are fetched asynchronously.
Definition: qgsfeaturefiltermodel.h:28
QgsFeatureRequest
This class wraps a request for features to a vector layer (or directly its vector data provider).
Definition: qgsfeaturerequest.h:83
QgsFeaturePickerModelBase::createEntry
virtual QgsFeatureExpressionValuesGatherer::Entry createEntry(const QVariant &identifier) const =0
Creates an entry with just the identifier so the feature can be retrieved in a next iteration.
QgsFeaturePickerModelBase::requestedAttributes
virtual QSet< QString > requestedAttributes() const
Returns the attributes to be fetched in the request.
Definition: qgsfeaturepickermodelbase.h:310
QgsFeaturePickerModelBase::requestToReloadCurrentFeature
virtual void requestToReloadCurrentFeature(QgsFeatureRequest &request)=0
Update the request to match the current feature to be reloaded.
QgsFeaturePickerModelBase::entryIdentifier
virtual QVariant entryIdentifier(const QgsFeatureExpressionValuesGatherer::Entry &entry) const =0
Returns the identifier of the given entry.
SIP_FORCE
#define SIP_FORCE
Definition: qgis_sip.h:131
QgsFeaturePickerModelBase::createValuesGatherer
virtual QgsFeatureExpressionValuesGatherer * createValuesGatherer(const QgsFeatureRequest &request) const =0
Creates the value gatherer.
QgsFeaturePickerModelBase::setExtraIdentifierValueToNull
virtual void setExtraIdentifierValueToNull()=0
Allows specifying one value that does not need to match the filter criteria but will still be availab...