QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
33 QMutexLocker locker( &layer->mFeatureSourceConstructorMutex );
56 if ( L->editBuffer()->addedFeatures().contains( request.filterFid() ) )
57 mAddedFeatures.insert( request.filterFid(), L->editBuffer()->addedFeatures()[ request.filterFid()] );
59 if ( L->editBuffer()->changedGeometries().contains( request.filterFid() ) )
60 mChangedGeometries.insert( request.filterFid(), L->editBuffer()->changedGeometries()[ request.filterFid()] );
62 if ( L->editBuffer()->deletedFeatureIds().contains( request.filterFid() ) )
65 if ( L->editBuffer()->changedAttributeValues().contains( request.filterFid() ) )
66 mChangedAttributeValues.insert( request.filterFid(), L->editBuffer()->changedAttributeValues()[ request.filterFid()] );
68 if ( L->editBuffer()->changedAttributeValues().contains( request.filterFid() ) )
69 mChangedFeaturesRequest.setFilterFids(
QgsFeatureIds() << request.filterFid() );
120 , mFetchedFid( false )
174 QSet<int> providerSubset;
177 for (
int attrIndex : subset )
179 if ( attrIndex < 0 || attrIndex >= nPendingFields )
193 for (
int attrIndex : usedAttributeIndices )
195 providerSubset << attrIndex;
206 for (
const QString &field : constReferencedColumns )
234 changedIds << attIt.key();
296 class QgsThreadStackOverflowGuard
300 QgsThreadStackOverflowGuard( QThreadStorage<QStack<QString>> &storage,
const QString &stackFrameInformation,
int maxDepth )
301 : mStorage( storage )
302 , mMaxDepth( maxDepth )
304 if ( !storage.hasLocalData() )
306 storage.setLocalData( QStack<QString>() );
309 storage.localData().push( stackFrameInformation );
312 ~QgsThreadStackOverflowGuard()
314 mStorage.localData().pop();
317 bool hasStackOverflow()
const
319 if ( mStorage.localData().size() > mMaxDepth )
325 QString topFrames()
const
327 QStringList dumpStack;
328 const QStack<QString> &stack = mStorage.localData();
330 int dumpSize = std::min( stack.size(), 10 );
331 for (
int i = 0; i < dumpSize; ++i )
333 dumpStack += stack.at( i );
336 return dumpStack.join(
'\n' );
341 return mStorage.localData().size();
345 QThreadStorage<QStack<QString>> &mStorage;
358 static QThreadStorage<QStack<QString>> sStack;
360 QgsThreadStackOverflowGuard guard( sStack,
mSource->
id(), 4 );
362 if ( guard.hasStackOverflow() )
373 if ( res && postProcessFeature( f ) )
447 if ( !postProcessFeature( f ) )
494 mInterruptionChecker = interruptionChecker;
520 if ( !postProcessFeature( f ) )
574 if ( postProcessFeature( f ) )
665 int sourceLayerIndex;
667 Q_ASSERT( joinInfo );
693 mFetchJoinInfo[ joinInfo ].attributes.push_back( sourceLayerIndex );
699 static QThreadStorage<QStack<QString>> sStack;
701 QgsThreadStackOverflowGuard guard( sStack,
mSource->
id(), 4 );
703 if ( guard.hasStackOverflow() )
712 std::unique_ptr<QgsExpression> exp = qgis::make_unique<QgsExpression>( exps[oi].cachedExpression );
717 exp->setGeomCalculator( &da );
721 if ( !mExpressionContext )
722 createExpressionContext();
723 exp->prepare( mExpressionContext.get() );
724 const QSet<int> referencedColumns = exp->referencedAttributeIndexes(
mSource->
fields() );
728 for (
int dependentFieldIdx : referencedColumns )
732 requestedAttributes += dependentFieldIdx;
735 if ( !mPreparedFields.contains( dependentFieldIdx ) && !mFieldsToPrepare.contains( dependentFieldIdx ) )
736 mFieldsToPrepare << dependentFieldIdx;
744 if ( exp->needsGeometry() )
754 mPreparedFields.clear();
755 mFieldsToPrepare.clear();
757 mOrderedJoinInfoList.clear();
759 mExpressionContext.reset();
763 while ( !mFieldsToPrepare.isEmpty() )
765 int fieldIdx = mFieldsToPrepare.takeFirst();
766 if ( mPreparedFields.contains( fieldIdx ) )
769 mPreparedFields << fieldIdx;
776 createOrderedJoinList();
780 void QgsVectorLayerFeatureIterator::createOrderedJoinList()
783 if ( mOrderedJoinInfoList.size() < 2 )
788 QSet<int> resolvedFields;
791 QList< int >::const_iterator prepFieldIt = mPreparedFields.constBegin();
792 for ( ; prepFieldIt != mPreparedFields.constEnd(); ++prepFieldIt )
796 resolvedFields.insert( *prepFieldIt );
803 int maxIterations = ( mOrderedJoinInfoList.size() + 1 ) * mOrderedJoinInfoList.size() / 2.0;
804 int currentIteration = 0;
806 for (
int i = 0; i < mOrderedJoinInfoList.size() - 1; ++i )
808 if ( !resolvedFields.contains( mOrderedJoinInfoList.at( i ).targetField ) )
810 mOrderedJoinInfoList.append( mOrderedJoinInfoList.at( i ) );
811 mOrderedJoinInfoList.removeAt( i );
816 int offset = mOrderedJoinInfoList.at( i ).indexOffset;
817 int joinField = mOrderedJoinInfoList.at( i ).joinField;
820 for (
int n = 0; n < attributes.size(); n++ )
822 if ( n != joinField )
824 resolvedFields.insert( joinField < n ? n + offset - 1 : n + offset );
830 if ( currentIteration >= maxIterations )
837 bool QgsVectorLayerFeatureIterator::postProcessFeature(
QgsFeature &feature )
839 bool result = checkGeometryValidity( feature );
845 bool QgsVectorLayerFeatureIterator::checkGeometryValidity(
const QgsFeature &feature )
910 QList< FetchJoinInfo >::const_iterator joinIt = mOrderedJoinInfoList.constBegin();
911 for ( ; joinIt != mOrderedJoinInfoList.constEnd(); ++joinIt )
913 QVariant targetFieldValue = f.
attribute( joinIt->targetField );
914 if ( !targetFieldValue.isValid() )
917 const QHash< QString, QgsAttributes> &memoryCache = joinIt->joinInfo->cachedAttributes;
918 if ( memoryCache.isEmpty() )
919 joinIt->addJoinedAttributesDirect( f, targetFieldValue );
921 joinIt->addJoinedAttributesCached( f, targetFieldValue );
935 QList< int > fetchedVirtualAttributes;
937 QMap<const QgsVectorLayerJoinInfo *, FetchJoinInfo>::const_iterator joinIt =
mFetchJoinInfo.constBegin();
944 fetchedVirtualAttributes << joinIt->targetField;
957 if ( fetchedVirtualAttributes.contains( it.key() ) )
970 if ( !mExpressionContext )
971 createExpressionContext();
973 mExpressionContext->setFeature( f );
974 QVariant val = exp->
evaluate( mExpressionContext.get() );
986 Q_UNUSED( simplifyMethod )
992 Q_UNUSED( methodType )
1000 QHash<QString, QgsAttributes>::const_iterator it = memoryCache.find( joinValue.toString() );
1001 if ( it == memoryCache.constEnd() )
1007 for (
int i = 0; i < featureAttributes.count(); ++i )
1018 if ( joinLayer && ! joinLayer->hasFeatures() )
1024 QString subsetString;
1026 QString joinFieldName = joinInfo->joinFieldName();
1028 subsetString.append( QStringLiteral(
"\"%1\"" ).arg( joinFieldName ) );
1030 if ( joinValue.isNull() )
1032 subsetString += QLatin1String(
" IS NULL" );
1036 QString v = joinValue.toString();
1037 switch ( joinValue.type() )
1040 case QVariant::LongLong:
1041 case QVariant::Double:
1045 case QVariant::String:
1046 v.replace(
'\'', QLatin1String(
"''" ) );
1047 v.prepend(
'\'' ).append(
'\'' );
1050 subsetString +=
'=' + v;
1055 QVector<int> subsetIndices;
1056 if ( joinInfo->hasSubset() )
1074 int index = indexOffset;
1076 if ( joinInfo->hasSubset() )
1078 for (
int i = 0; i < subsetIndices.count(); ++i )
1079 f.
setAttribute( index++, attr.at( subsetIndices.at( i ) ) );
1084 for (
int i = 0; i < attr.count(); ++i )
1086 if ( i == joinField )
1120 if ( iter->id() == featureId )
1162 for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); ++it )
1163 attrs[it.key()] = it.value();
1174 void QgsVectorLayerFeatureIterator::createExpressionContext()
1176 mExpressionContext = qgis::make_unique< QgsExpressionContext >();
1182 bool QgsVectorLayerFeatureIterator::prepareOrderBy(
const QList<QgsFeatureRequest::OrderByClause> &orderBys )
1184 Q_UNUSED( orderBys )
1195 , mSelectedFeatureIds( layer->selectedFeatureIds() )
1196 , mWkbType( layer->wkbType() )
1197 , mName( layer->name() )
1222 return QgsFeatureIterator(
new QgsVectorLayerSelectedFeatureIterator( mSelectedFeatureIds, req, mSource ) );
1227 return mSource.
crs();
1242 return mSelectedFeatureIds.count();
1253 return mLayer->createExpressionContextScope();
1261 return mLayer->hasSpatialIndex();
1273 , mSelectedFeatureIds( selectedFeatureIds )
1286 bool QgsVectorLayerSelectedFeatureIterator::rewind()
1288 return mIterator.
rewind();
1291 bool QgsVectorLayerSelectedFeatureIterator::close()
1293 return mIterator.close();
1296 bool QgsVectorLayerSelectedFeatureIterator::fetchFeature(
QgsFeature &f )
1298 while ( mIterator.nextFeature( f ) )
1300 if ( mSelectedFeatureIds.contains( f.
id() ) )
@ OriginProvider
Field comes from the underlying data provider of the vector layer (originIndex = index in provider's ...
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
bool fetchNextAddedFeature(QgsFeature &f)
std::function< void(const QgsFeature &) > invalidGeometryCallback() const
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck()...
QgsCoordinateReferenceSystem crs
QgsExpressionContextScope mLayerScope
Q_INVOKABLE QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) override
Gets an iterator for features matching the specified request.
QgsFeatureIterator mChangedFeaturesIterator
void setInterruptionChecker(QgsFeedback *interruptionChecker) override
Attach an object that can be queried regularly by the iterator to check if it must stopped.
static QVector< int > joinSubsetIndices(QgsVectorLayer *joinLayer, const QStringList &joinFieldsSubset)
Returns a vector of indices for use in join based on field names from the layer.
@ OriginEdit
Field has been temporarily added in editing mode (originIndex = index in the list of added attributes...
@ FilterFid
Filter using feature ID.
void prepareJoin(int fieldIdx)
const QgsFeatureIds & filterFids() const
Gets feature IDs that should be fetched.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
@ GeometryAbortOnInvalid
Close iterator on encountering any features with invalid geometry. This requires a slow geometry vali...
void addJoinedAttributesDirect(QgsFeature &f, const QVariant &joinValue) const
QgsCoordinateTransformContext transformContext() const
Returns the transform context, for use when a destinationCrs() has been set and reprojection is requi...
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
bool acceptFeature(const QgsFeature &feature)
Check if a feature is accepted by this requests filter.
QgsCoordinateTransform mTransform
QSet< QString > referencedColumns() const
Gets list of columns referenced by the expression.
void setId(QgsFeatureId id)
Sets the feature ID for this feature.
QgsVectorLayerFeatureIterator(QgsVectorLayerFeatureSource *source, bool ownSource, const QgsFeatureRequest &request)
QgsCoordinateReferenceSystem sourceCrs() const override
Returns the coordinate reference system for features in the source.
void addVirtualAttributes(QgsFeature &f)
Adds attributes that don't source from the provider but are added inside QGIS Includes.
QgsFeatureId filterFid() const
Gets the feature ID that should be fetched.
QgsFeatureMap mAddedFeatures
const Flags & flags() const
const QgsRectangle & filterRect() const
Returns the rectangle from which features will be taken.
void iteratorClosed()
to be called by from subclass in close()
QMap< int, QgsExpression * > mExpressionFieldInfo
FilterType filterType() const
Returns the filter type which is currently set on this request.
bool mClosed
Sets to true, as soon as the iterator is closed.
int count() const
Returns number of items.
QSet< int > referencedAttributeIndexes(const QgsFields &fields) const
Returns a list of field name indexes obtained from the provided fields.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
QgsAttributeList mDeletedAttributeIds
QgsCoordinateTransformContext transformContext
void setValid(bool validity)
Sets the validity of the feature.
QgsFields fields() const
Returns the fields that will be available for features that are retrieved from this source.
static QgsProject * instance()
Returns the QgsProject singleton instance.
const QgsVectorLayerJoinInfo * joinForFieldIndex(int index, const QgsFields &fields, int &sourceFieldIndex) const
Finds the vector join for a layer field index.
QStringList * joinFieldNamesSubset() const
Returns the subset of fields to be used from joined layer.
QgsVectorLayerFeatureSource * mSource
QgsChangedAttributesMap mChangedAttributeValues
bool fetchNextChangedAttributeFeature(QgsFeature &f)
void setFields(const QgsFields &fields)
Convenience function for setting a fields for the context.
Type
The WKB type describes the number of dimensions a geometry has.
QgsFeatureIterator mProviderIterator
QgsCoordinateReferenceSystem destinationCrs() const
Returns the destination coordinate reference system for feature's geometries, or an invalid QgsCoordi...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QgsFeatureRequest mRequest
A copy of the feature request.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
void addExpressionAttribute(QgsFeature &f, int attrIndex)
Adds an expression based attribute to a feature.
QString sourceName() const override
Returns a friendly display name for the source.
bool isClosed() const
find out whether the iterator is still valid or closed already
QgsVectorLayerJoinBuffer * mJoinBuffer
@ GeometrySkipInvalid
Skip any features with invalid geometry. This requires a slow geometry validity check for every featu...
void addJoinedAttributes(QgsFeature &f)
QgsGeometryMap::ConstIterator mFetchChangedGeomIt
QList< int > QgsAttributeList
@ SubsetOfAttributes
Fetch only a subset of attributes (setSubsetOfAttributes sets this flag)
QgsFeatureRequest & disableFilter()
Disables filter conditions.
QgsFeatureRequest & setFilterFid(QgsFeatureId fid)
Sets feature ID that should be fetched.
QgsExpressionContext * expressionContext()
Returns the expression context used to evaluate filter expressions.
QgsGeometryMap mChangedGeometries
void addJoinedAttributesCached(QgsFeature &f, const QVariant &joinValue) const
int joinedFieldsOffset(const QgsVectorLayerJoinInfo *info, const QgsFields &fields)
Find out what is the first index of the join within fields.
QgsVectorLayerSelectedFeatureSource(QgsVectorLayer *layer)
Constructor for QgsVectorLayerSelectedFeatureSource, for selected features from the specified layer.
QgsFeatureRequest & setFilterExpression(const QString &expression)
Set the filter expression.
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
QString targetFieldName() const
Returns name of the field of our layer that will be used for join.
QgsFields fields() const FINAL
Returns the list of fields of this layer.
QgsWkbTypes::Type wkbType() const override
Returns the geometry type for features returned by this source.
bool fetchFeature(QgsFeature &feature) override
fetch next feature, return true on success
bool setEllipsoid(const QString &ellipsoid)
Sets the ellipsoid by its acronym.
QgsRectangle filterRectToSourceCrs(const QgsCoordinateTransform &transform) const SIP_THROW(QgsCsException)
Returns a rectangle representing the original request's QgsFeatureRequest::filterRect().
QgsFeatureRequest mChangedFeaturesRequest
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
int joinField
Index of field (of the joined layer) must have equal value.
void prepareField(int fieldIdx)
bool prepareSimplification(const QgsSimplifyMethod &simplifyMethod) override
Setup the simplification of geometries to fetch using the specified simplify method.
QgsVectorLayer * joinLayer
Resolved pointer to the joined layer.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
QgsExpressionContextScope * createExpressionContextScope() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QgsAttributeList deletedAttributeIds() const
Returns a list of deleted attributes fields which are not committed.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching)
void setFields(const QgsFields &fields, bool initAttributes=false)
Assign a field map with the feature to allow attribute access by attribute name.
bool exists(int i) const
Returns if a field index is valid.
QgsFields fields() const override
Returns the fields associated with features in the source.
virtual QgsAbstractFeatureSource * featureSource() const =0
Returns feature source object that can be used for querying provider's data.
@ OriginUnknown
It has not been specified where the field comes from.
QString id() const
Returns the layer id of the source layer.
QList< QgsField > mAddedAttributes
QgsChangedAttributesMap changedAttributeValues() const
Returns a map of features with changed attributes values which are not committed.
SpatialIndexPresence
Enumeration of spatial index presence states.
QgsExpression * filterExpression() const
Returns the filter expression if set.
QgsVectorLayerJoinBuffer * clone() const
Create a copy of the join buffer.
bool convertCompatible(QVariant &v) const
Converts the provided variant to a compatible format.
void updateFeatureGeometry(QgsFeature &f)
Update feature with uncommitted geometry updates.
FieldOrigin fieldOrigin(int fieldIdx) const
Gets field's origin (value from an enumeration)
void updateChangedAttributes(QgsFeature &f)
Update feature with uncommitted attribute updates.
QMap< int, QVariant > QgsAttributeMap
~QgsVectorLayerFeatureIterator() override
bool isValid() const
Returns whether this CRS is correctly initialized and usable.
void useAddedFeature(const QgsFeature &src, QgsFeature &f)
QString joinFieldName() const
Returns name of the field of joined layer that will be used for join.
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
QgsFeatureRequest & setFilterFids(const QgsFeatureIds &fids)
Sets feature IDs that should be fetched.
void createJoinCaches()
Calls cacheJoinLayer() for all vector joins.
bool nextFeatureFid(QgsFeature &f)
QList< QgsExpressionFieldBuffer::ExpressionField > expressions() const
void prepareExpression(int fieldIdx)
void setSourceCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets source spatial reference system crs.
@ FilterExpression
Filter using expression.
QMap< QgsFeatureId, QgsFeature > QgsFeatureMap
int indexOffset
At what position the joined fields start.
void geometryToDestinationCrs(QgsFeature &feature, const QgsCoordinateTransform &transform) const
Transforms feature's geometry according to the specified coordinate transform.
bool prepare(const QgsExpressionContext *context)
Gets the expression ready for evaluation - find out column indexes.
QSet< QgsFeatureId > QgsFeatureIds
QgsCoordinateReferenceSystem mCrs
QVariant evaluate()
Evaluate the feature and return the result.
Single scope for storing variables and functions for use within a QgsExpressionContext....
int targetField
Index of field (of this layer) that drives the join.
QSet< int > CORE_EXPORT usedAttributeIndices(const QgsFields &fields) const
Returns a set of used, validated attribute indices.
QgsFeatureRequest mProviderRequest
Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAtt...
QgsFeatureIds deletedFeatureIds() const
Returns a list of deleted feature IDs which are not committed.
friend class QgsVectorLayerFeatureIterator
QgsAttributeList allAttributesList() const
Utility function to get list of attribute indexes.
bool setAttribute(int field, const QVariant &attr)
Set an attribute's value by field index.
bool rewind() override
reset the iterator to the starting position
@ OriginExpression
Field is calculated from an expression.
QgsExpressionFieldBuffer * mExpressionFieldBuffer
bool nextFeature(QgsFeature &f)
long featureCount() const override
Returns the number of features contained in the source, or -1 if the feature count is unknown.
bool mHasVirtualAttributes
@ SpatialIndexUnknown
Spatial index presence cannot be determined, index may or may not exist.
InvalidGeometryCheck invalidGeometryCheck() const
Returns the invalid geometry checking behavior.
OrderBy orderBy() const
Returns a list of order by clauses specified for this feature request.
bool hasGeometry() const
Returns true if the feature has an associated geometry.
QgsFeatureRequest & setLimit(long limit)
Set the maximum number of features to request.
QSet< QgsFeatureId > mFetchConsidered
QgsAttributeList subsetOfAttributes() const
Returns the subset of attributes which at least need to be fetched.
QgsVectorLayer * joinLayer() const
Returns joined layer (may be nullptr if the reference was set by layer ID and not resolved yet)
QgsGeometryMap changedGeometries() const
Returns a map of features with changed geometries which are not committed.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
int fieldOriginIndex(int fieldIdx) const
Gets field's origin index (its meaning is specific to each type of origin)
QgsVectorLayerFeatureSource(const QgsVectorLayer *layer)
Constructor for QgsVectorLayerFeatureSource.
@ GeometryNoCheck
No invalid geometry checking.
bool containsJoins() const
Quick way to test if there is any join at all.
void useChangedAttributeFeature(QgsFeatureId fid, const QgsGeometry &geom, QgsFeature &f)
bool needsGeometry() const
Returns true if the expression uses feature geometry for some computation.
~QgsVectorLayerFeatureSource() override
@ FilterNone
No filter is applied.
bool close() override
end of iterating: free the resources / lock
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())=0
Gets an iterator for features matching the specified request.
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
void setInterruptionChecker(QgsFeedback *interruptionChecker)
Attach an object that can be queried regularly by the iterator to check if it must stopped.
bool isValid() const override
Returns if this iterator is valid.
QgsAbstractFeatureSource * mProviderFeatureSource
QgsCoordinateReferenceSystem crs() const
Returns the coordinate reference system for features retrieved from this source.
QgsFeatureRequest & setDestinationCrs(const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context)
Sets the destination crs for feature's geometries.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const override
Returns an iterator for the features in the source.
bool isGeosValid(QgsGeometry::ValidityFlags flags=QgsGeometry::ValidityFlags()) const
Checks validity of the geometry using GEOS.
SpatialIndexPresence hasSpatialIndex() const override
Returns an enum value representing the presence of a valid spatial index on the source,...
const QgsVectorLayerJoinInfo * joinInfo
Canonical source of information about the join.
void setAttributes(const QgsAttributes &attrs)
Sets the feature's attributes.
int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)
QList< QgsField > addedAttributes() const
Returns a list of added attributes fields which are not committed.
QgsFeatureRequest & setFlags(QgsFeatureRequest::Flags flags)
Sets flags that affect how features will be fetched.
const QgsAttributeList & attributeIndexes
bool fetchNextChangedGeomFeature(QgsFeature &f)
QgsFeatureIds mDeletedFeatureIds
QMap< const QgsVectorLayerJoinInfo *, QgsVectorLayerFeatureIterator::FetchJoinInfo > mFetchJoinInfo
Information about joins used in the current select() statement.
QgsFeatureMap addedFeatures() const
Returns a map of new features which are not committed.
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
bool isValid() const
Will return if this iterator is valid.
int indexFromName(const QString &fieldName) const
Gets the field index from the field name.
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt
@ OriginJoin
Field comes from a joined layer (originIndex / 1000 = index of the join, originIndex % 1000 = index w...
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
long limit() const
Returns the maximum number of features to request, or -1 if no limit set.