36 auto addFeatureSynchronized = [
this, &feature, &res ]()
57 selectedFeatureIds.insert( feature.
id() );
74 auto addFeatureSynchronized = [
this, &features, &res ]()
95 for (
const QgsFeature &feature : qgis::as_const( features ) )
96 selectedFeatureIds.insert( feature.id() );
103 for (
const QgsFeature &feature : qgis::as_const( features ) )
148 void QgsVectorLayerFeaturePool::onFeatureDeleted(
QgsFeatureId fid )
bool isFeatureCached(QgsFeatureId fid)
Checks if the feature fid is cached.
void deleteFeature(QgsFeatureId fid) override
Removes a feature from this pool.
QSet< QgsFeatureId > QgsFeatureIds
bool getFeature(QgsFeatureId id, QgsFeature &feature, QgsFeedback *feedback=nullptr)
Retrieves the feature with the specified id into feature.
QList< QgsFeature > QgsFeatureList
bool deleteFeatures(const QgsFeatureIds &fids)
Deletes a set of features from the layer (but does not commit it)
A geometry is the spatial representation of a feature.
void selectByIds(const QgsFeatureIds &ids, SelectBehavior behavior=SetSelection)
Select matching features using a list of feature IDs.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
void featureDeleted(QgsFeatureId fid)
Emitted when a feature has been deleted.
bool updateFeature(QgsFeature &feature, bool skipDefaultValues=false)
Updates an existing feature in the layer, replacing the attributes and geometry for the feature with ...
QgsVectorLayer * layer() const
Gets a pointer to the underlying layer.
void insertFeature(const QgsFeature &feature)
Inserts a feature into the cache and the spatial index.
void updateFeature(QgsFeature &feature) override
Updates a feature in this pool.
const QgsFeatureIds & selectedFeatureIds() const
Returns a list of the selected features IDs in this layer.
void refreshCache(const QgsFeature &feature)
Changes a feature in the cache and the spatial index.
QgsVectorLayerFeaturePool(QgsVectorLayer *layer)
Creates a new feature pool for layer.
bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr) FINAL
Adds a list of features to the sink.
void geometryChanged(QgsFeatureId fid, const QgsGeometry &geometry)
Is emitted whenever a geometry change is done in the edit buffer.
static bool runOnMainThread(const Func &func, QgsFeedback *feedback=nullptr)
Guarantees that func is executed on the main thread.
bool addFeatures(QgsFeatureList &features, QgsFeatureSink::Flags flags=nullptr) override
Adds a list of features to the sink.
A feature pool is based on a vector layer and caches features.
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr) override
Adds a single feature to the sink.
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=nullptr) FINAL
Adds a single feature to the sink.
Represents a vector layer which manages a vector based data sets.
void removeFeature(const QgsFeatureId featureId)
Removes a feature from the cache and the spatial index.