QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
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
22
30{
31 Q_OBJECT
32
39
40
44
45 public:
46#ifndef SIP_RUN
49#endif
50
54 explicit QgsFeatureFilterModel( QObject *parent = nullptr );
55
62 Q_DECL_DEPRECATED QString identifierField() const;
63
69 QStringList identifierFields() const;
70
77 void setIdentifierFields( const QStringList &identifierFields );
78
84 void setExtraIdentifierValueToNull() override;
85
91 QVariantList extraIdentifierValues() const;
92
98 void setExtraIdentifierValues( const QVariantList &extraIdentifierValues );
99
100
101 signals:
102
108
114
115 private:
116 QgsFeatureExpressionValuesGatherer *createValuesGatherer( const QgsFeatureRequest &request ) const override;
117
119
120 QSet<QString> requestedAttributes() const override;
121
122 QVariant entryIdentifier( const QgsFeatureExpressionValuesGatherer::Entry &entry ) const override;
123
124 QgsFeatureExpressionValuesGatherer::Entry createEntry( const QVariant &identifier ) const override;
125
126 bool compareEntries( const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b ) const override;
127
128 bool identifierIsNull( const QVariant &identifier ) const override;
129
130 QVariant nullIdentifier() const override;
131
132 QStringList mIdentifierFields;
133};
134
135#endif // QGSFEATUREFILTERMODEL_H
void setExtraIdentifierValues(const QVariantList &extraIdentifierValues)
Allows specifying one value that does not need to match the filter criteria but will still be availab...
void extraIdentifierValuesChanged()
Allows specifying one value that does not need to match the filter criteria but will still be availab...
Q_DECL_DEPRECATED QString identifierField() const
The identifier field should be a unique field that can be used to identify individual features.
QgsFeatureFilterModel(QObject *parent=nullptr)
Create a new QgsFeatureFilterModel, optionally specifying a parent.
static const QgsSettingsEntryInteger * settingsMaxEntriesRelationWidget
Settings for maximum number of entries in relation widget.
QStringList identifierFields
A set of fields of sourceLayer that is unique and should be used to identify features.
QVariantList extraIdentifierValues
The values that identifies the current feature.
void identifierFieldsChanged()
The identifier field should be a unique field that can be used to identify individual features.
void setIdentifierFields(const QStringList &identifierFields)
The identifier field should be a unique field that can be used to identify individual features.
virtual QVariant entryIdentifier(const QgsFeatureExpressionValuesGatherer::Entry &entry) const =0
Returns the identifier of the given entry.
virtual void setExtraIdentifierValueToNull()=0
Allows specifying one value that does not need to match the filter criteria but will still be availab...
virtual void requestToReloadCurrentFeature(QgsFeatureRequest &request)=0
Update the request to match the current feature to be reloaded.
virtual QgsFeatureExpressionValuesGatherer * createValuesGatherer(const QgsFeatureRequest &request) const =0
Creates the value gatherer.
virtual QSet< QString > requestedAttributes() const
Returns the attributes to be fetched in the request.
QModelIndex parent(const QModelIndex &child) const override
QgsFeaturePickerModelBase(QObject *parent=nullptr)
Create a new QgsFeaturePickerModelBase, optionally specifying a parent.
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.
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...
virtual bool compareEntries(const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b) const =0
Returns true if the 2 entries refers to the same feature.
virtual QVariant nullIdentifier() const =0
Returns a null identifier.
Wraps a request for features to a vector layer (or directly its vector data provider).
An integer settings entry.
#define SIP_FORCE
Definition qgis_sip.h:138