QGIS API Documentation 3.39.0-Master (699c004a5df)
Loading...
Searching...
No Matches
qgsfeaturepickermodel.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeaturepickermodel.h - QgsFeaturePickerModel
3 ---------------------
4 begin : 03.04.2020
5 copyright : (C) 2020 by Denis Rouzaud
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 QGSFEATUREPICKERMODEL_H
16#define QGSFEATUREPICKERMODEL_H
17
18#include <QAbstractItemModel>
19
20#include "qgsconditionalstyle.h"
23
31{
32 Q_OBJECT
33
34 public:
35
39 explicit QgsFeaturePickerModel( QObject *parent = nullptr );
40
46 void setExtraIdentifierValueToNull() override;
47
49 void setFeature( const QgsFeatureId &fid );
50
54 QgsFeature feature() const;
55
56 signals:
58 void featureChanged( const QgsFeature &feature );
59
60
61 private:
62 QgsFeatureExpressionValuesGatherer *createValuesGatherer( const QgsFeatureRequest &request ) const override;
63
64 void requestToReloadCurrentFeature( QgsFeatureRequest &request ) override;
65
66 QVariant entryIdentifier( const QgsFeatureExpressionValuesGatherer::Entry &entry ) const override;
67
68 QgsFeatureExpressionValuesGatherer::Entry createEntry( const QVariant &identifier ) const override;
69
70 bool compareEntries( const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b ) const override;
71
72 bool identifierIsNull( const QVariant &identifier ) const override;
73
74 QVariant nullIdentifier() const override;
75};
76
77#endif // QGSFEATUREPICKERMODEL_H
Provides a list of features based on filter conditions.
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 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.
Provides a list of features based on filter conditions.
void featureChanged(const QgsFeature &feature)
Emitted when the current feature changes.
This class wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features