21 #include "qgssettings.h"
33 void QgsFeaturePickerModel::requestToReloadCurrentFeature(
QgsFeatureRequest &request )
38 QVariant QgsFeaturePickerModel::entryIdentifier(
const QgsFeatureExpressionValuesGatherer::Entry &entry )
const
40 return entry.identifierFields;
43 QgsFeatureExpressionValuesGatherer::Entry QgsFeaturePickerModel::createEntry(
const QVariant &identifier )
const
46 return QgsFeatureExpressionValuesGatherer::Entry( fid, QStringLiteral(
"(%1)" ).arg( fid ),
sourceLayer() );
49 bool QgsFeaturePickerModel::compareEntries(
const QgsFeatureExpressionValuesGatherer::Entry &a,
const QgsFeatureExpressionValuesGatherer::Entry &b )
const
51 return a.featureId == b.featureId;
54 bool QgsFeaturePickerModel::identifierIsNull(
const QVariant &identifier )
const
56 return identifier.value<
QgsFeatureId>() == nullIdentifier();
59 QVariant QgsFeaturePickerModel::nullIdentifier()
const
79 QgsFeatureExpressionValuesGatherer *QgsFeaturePickerModel::createValuesGatherer(
const QgsFeatureRequest &request )
const
Provides a list of features based on filter conditions.
void extraIdentifierValueIndexChanged(int index)
The index at which the extra identifier value is available within the model.
void setExtraIdentifierValue(const QVariant &extraIdentifierValue)
Allows specifying one value that does not need to match the filter criteria but will still be availab...
void setFetchGeometry(bool fetchGeometry)
Defines if the geometry will be fetched.
void setExtraIdentifierValueUnguarded(const QVariant &identifierValue)
This will set the identifier value to be set in the model even if it doesn't exist currently in the d...
int mExtraValueIndex
The current index.
QVariant mExtraIdentifierValue
The current identifier value.
QgsVectorLayer * sourceLayer
QString displayExpression
QVector< QgsFeatureExpressionValuesGatherer::Entry > mEntries
QgsFeaturePickerModel(QObject *parent=nullptr)
Create a new QgsFeaturePickerModel, optionally specifying a parent.
void setFeature(const QgsFeatureId &fid)
Set the feature to the given feature id.
void featureChanged(const QgsFeature &feature)
Emitted when the current feature changes.
void setExtraIdentifierValueToNull() override
Allows specifying one value that does not need to match the filter criteria but will still be availab...
QgsFeature feature() const
Returns the current feature.
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureRequest & setFilterFid(QgsFeatureId fid)
Sets feature ID that should be fetched.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features