16#include "moc_qgsfeaturepickermodel.cpp"
34void QgsFeaturePickerModel::requestToReloadCurrentFeature(
QgsFeatureRequest &request )
39QVariant QgsFeaturePickerModel::entryIdentifier(
const QgsFeatureExpressionValuesGatherer::Entry &entry )
const
41 return entry.identifierFields;
44QgsFeatureExpressionValuesGatherer::Entry QgsFeaturePickerModel::createEntry(
const QVariant &identifier )
const
47 return QgsFeatureExpressionValuesGatherer::Entry( fid, QStringLiteral(
"(%1)" ).arg( fid ),
sourceLayer() );
50bool QgsFeaturePickerModel::compareEntries(
const QgsFeatureExpressionValuesGatherer::Entry &a,
const QgsFeatureExpressionValuesGatherer::Entry &b )
const
52 return a.featureId == b.featureId;
55bool QgsFeaturePickerModel::identifierIsNull(
const QVariant &identifier )
const
57 return identifier.value<
QgsFeatureId>() == nullIdentifier();
60QVariant QgsFeaturePickerModel::nullIdentifier()
const
80QgsFeatureExpressionValuesGatherer *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 the 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