25#include "moc_qgsfeaturepickermodel.cpp"
27using namespace Qt::StringLiterals;
38void QgsFeaturePickerModel::requestToReloadCurrentFeature(
QgsFeatureRequest &request )
43QVariant QgsFeaturePickerModel::entryIdentifier(
const QgsFeatureExpressionValuesGatherer::Entry &entry )
const
45 return entry.identifierFields;
48QgsFeatureExpressionValuesGatherer::Entry QgsFeaturePickerModel::createEntry(
const QVariant &identifier )
const
51 return QgsFeatureExpressionValuesGatherer::Entry( fid, u
"(%1)"_s.arg( fid ),
sourceLayer() );
54bool QgsFeaturePickerModel::compareEntries(
const QgsFeatureExpressionValuesGatherer::Entry &a,
const QgsFeatureExpressionValuesGatherer::Entry &b )
const
56 return a.featureId == b.featureId;
59bool QgsFeaturePickerModel::identifierIsNull(
const QVariant &identifier )
const
84QgsFeatureExpressionValuesGatherer *QgsFeaturePickerModel::createValuesGatherer(
const QgsFeatureRequest &request )
const
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.
QModelIndex parent(const QModelIndex &child) const override
QVariant mExtraIdentifierValue
The current identifier value.
QgsFeaturePickerModelBase(QObject *parent=nullptr)
Create a new QgsFeaturePickerModelBase, optionally specifying a parent.
QgsVectorLayer * sourceLayer
QString displayExpression
QVector< QgsFeatureExpressionValuesGatherer::Entry > mEntries
virtual QVariant nullIdentifier() const =0
Returns a null identifier.
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.
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