QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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
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 QGSFEATUREPICKERMODEL_H
16 #define QGSFEATUREPICKERMODEL_H
17 
18 #include <QAbstractItemModel>
19 
20 #include "qgsconditionalstyle.h"
23 
32 {
33  Q_OBJECT
34 
35  public:
36 
40  explicit QgsFeaturePickerModel( QObject *parent = nullptr );
41 
47  void setExtraIdentifierValueToNull() override;
48 
50  void setFeature( const QgsFeatureId &fid );
51 
55  QgsFeature feature() const;
56 
57  signals:
59  void featureChanged( const QgsFeature &feature );
60 
61 
62  private:
63  QgsFeatureExpressionValuesGatherer *createValuesGatherer( const QgsFeatureRequest &request ) const override;
64 
65  void requestToReloadCurrentFeature( QgsFeatureRequest &request ) override;
66 
67  QVariant entryIdentifier( const QgsFeatureExpressionValuesGatherer::Entry &entry ) const override;
68 
69  QgsFeatureExpressionValuesGatherer::Entry createEntry( const QVariant &identifier ) const override;
70 
71  bool compareEntries( const QgsFeatureExpressionValuesGatherer::Entry &a, const QgsFeatureExpressionValuesGatherer::Entry &b ) const override;
72 
73  bool identifierIsNull( const QVariant &identifier ) const override;
74 
75  QVariant nullIentifier() const override;
76 };
77 
78 #endif // QGSFEATUREPICKERMODEL_H
qgsconditionalstyle.h
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
Definition: qgsfeaturepickermodelbase.h:30
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...
QgsFeaturePickerModel
Definition: qgsfeaturepickermodel.h:31
QgsFeatureRequest
Definition: qgsfeaturerequest.h:75
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.
qgsfeatureexpressionvaluesgatherer.h
QgsFeaturePickerModelBase::nullIentifier
virtual QVariant nullIentifier() const =0
Returns a null identifier.
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.
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...
QgsFeature
Definition: qgsfeature.h:55
QgsFeatureId
qint64 QgsFeatureId
Definition: qgsfeatureid.h:25