QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | List of all members
QgsVectorLayerSelectedFeatureSource Class Reference

QgsFeatureSource subclass for the selected features from a QgsVectorLayer. More...

#include <qgsvectorlayerfeatureiterator.h>

Inheritance diagram for QgsVectorLayerSelectedFeatureSource:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorLayerSelectedFeatureSource (const QgsVectorLayerSelectedFeatureSource &other)=delete
 QgsVectorLayerSelectedFeatureSource cannot be copied. More...
 
 QgsVectorLayerSelectedFeatureSource (QgsVectorLayer *layer)
 Constructor for QgsVectorLayerSelectedFeatureSource, for selected features from the specified layer. More...
 
QgsExpressionContextScopecreateExpressionContextScope () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context scope. More...
 
long long featureCount () const override
 Returns the number of features contained in the source, or -1 if the feature count is unknown. More...
 
QgsFields fields () const override
 Returns the fields associated with features in the source. More...
 
QgsFeatureIterator getFeatures (const QgsFeatureRequest &request=QgsFeatureRequest()) const override
 Returns an iterator for the features in the source. More...
 
SpatialIndexPresence hasSpatialIndex () const override
 Returns an enum value representing the presence of a valid spatial index on the source, if it can be determined. More...
 
QgsVectorLayerSelectedFeatureSourceoperator== (const QgsVectorLayerSelectedFeatureSource &other)=delete
 QgsVectorLayerSelectedFeatureSource cannot be copied. More...
 
QgsCoordinateReferenceSystem sourceCrs () const override
 Returns the coordinate reference system for features in the source. More...
 
QString sourceName () const override
 Returns a friendly display name for the source. More...
 
QgsWkbTypes::Type wkbType () const override
 Returns the geometry type for features returned by this source. More...
 
- Public Member Functions inherited from QgsFeatureSource
virtual ~QgsFeatureSource ()=default
 
virtual QgsFeatureIds allFeatureIds () const
 Returns a list of all feature IDs for features present in the source. More...
 
virtual long long featureCount () const =0
 Returns the number of features contained in the source, or -1 if the feature count is unknown. More...
 
virtual QgsFields fields () const =0
 Returns the fields associated with features in the source. More...
 
virtual QgsFeatureIterator getFeatures (const QgsFeatureRequest &request=QgsFeatureRequest()) const =0
 Returns an iterator for the features in the source. More...
 
virtual FeatureAvailability hasFeatures () const
 Determines if there are any features available in the source. More...
 
virtual SpatialIndexPresence hasSpatialIndex () const
 Returns an enum value representing the presence of a valid spatial index on the source, if it can be determined. More...
 
QgsVectorLayermaterialize (const QgsFeatureRequest &request, QgsFeedback *feedback=nullptr)
 Materializes a request (query) made against this feature source, by running it over the source and returning a new memory based vector layer containing the result. More...
 
virtual QVariant maximumValue (int fieldIndex) const
 Returns the maximum value for an attribute column or an invalid variant in case of error. More...
 
virtual QVariant minimumValue (int fieldIndex) const
 Returns the minimum value for an attribute column or an invalid variant in case of error. More...
 
virtual QgsCoordinateReferenceSystem sourceCrs () const =0
 Returns the coordinate reference system for features in the source. More...
 
virtual QgsRectangle sourceExtent () const
 Returns the extent of all geometries from the source. More...
 
virtual QString sourceName () const =0
 Returns a friendly display name for the source. More...
 
virtual QSet< QVariant > uniqueValues (int fieldIndex, int limit=-1) const
 Returns the set of unique values contained within the specified fieldIndex from this source. More...
 
virtual QgsWkbTypes::Type wkbType () const =0
 Returns the geometry type for features returned by this source. More...
 
- Public Member Functions inherited from QgsExpressionContextScopeGenerator
virtual ~QgsExpressionContextScopeGenerator ()=default
 
virtual QgsExpressionContextScopecreateExpressionContextScope () const =0
 This method needs to be reimplemented in all classes which implement this interface and return an expression context scope. More...
 

Additional Inherited Members

- Public Types inherited from QgsFeatureSource
enum  FeatureAvailability { NoFeaturesAvailable , FeaturesAvailable , FeaturesMaybeAvailable }
 Possible return value for hasFeatures() to determine if a source is empty. More...
 
enum  SpatialIndexPresence { SpatialIndexUnknown = 0 , SpatialIndexNotPresent = 1 , SpatialIndexPresent = 2 }
 Enumeration of spatial index presence states. More...
 

Detailed Description

QgsFeatureSource subclass for the selected features from a QgsVectorLayer.

Since
QGIS 3.0

Definition at line 345 of file qgsvectorlayerfeatureiterator.h.

Constructor & Destructor Documentation

◆ QgsVectorLayerSelectedFeatureSource() [1/2]

QgsVectorLayerSelectedFeatureSource::QgsVectorLayerSelectedFeatureSource ( QgsVectorLayer layer)

Constructor for QgsVectorLayerSelectedFeatureSource, for selected features from the specified layer.

The currently selected feature IDs are stored, so change to the layer selection after constructing the QgsVectorLayerSelectedFeatureSource will not be reflected.

Definition at line 1296 of file qgsvectorlayerfeatureiterator.cpp.

◆ QgsVectorLayerSelectedFeatureSource() [2/2]

QgsVectorLayerSelectedFeatureSource::QgsVectorLayerSelectedFeatureSource ( const QgsVectorLayerSelectedFeatureSource other)
delete

Member Function Documentation

◆ createExpressionContextScope()

QgsExpressionContextScope * QgsVectorLayerSelectedFeatureSource::createExpressionContextScope ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context scope.

Since
QGIS 3.0

Implements QgsExpressionContextScopeGenerator.

Definition at line 1353 of file qgsvectorlayerfeatureiterator.cpp.

◆ featureCount()

long long QgsVectorLayerSelectedFeatureSource::featureCount ( ) const
overridevirtual

Returns the number of features contained in the source, or -1 if the feature count is unknown.

Implements QgsFeatureSource.

Definition at line 1343 of file qgsvectorlayerfeatureiterator.cpp.

◆ fields()

QgsFields QgsVectorLayerSelectedFeatureSource::fields ( ) const
overridevirtual

Returns the fields associated with features in the source.

Implements QgsFeatureSource.

Definition at line 1333 of file qgsvectorlayerfeatureiterator.cpp.

◆ getFeatures()

QgsFeatureIterator QgsVectorLayerSelectedFeatureSource::getFeatures ( const QgsFeatureRequest request = QgsFeatureRequest()) const
overridevirtual

Returns an iterator for the features in the source.

An optional request can be used to optimise the returned iterator, eg by restricting the returned attributes or geometry.

Implements QgsFeatureSource.

Definition at line 1304 of file qgsvectorlayerfeatureiterator.cpp.

◆ hasSpatialIndex()

QgsFeatureSource::SpatialIndexPresence QgsVectorLayerSelectedFeatureSource::hasSpatialIndex ( ) const
overridevirtual

Returns an enum value representing the presence of a valid spatial index on the source, if it can be determined.

If QgsFeatureSource::SpatialIndexUnknown is returned then the presence of an index cannot be determined.

Since
QGIS 3.10.1

Reimplemented from QgsFeatureSource.

Definition at line 1361 of file qgsvectorlayerfeatureiterator.cpp.

◆ operator==()

QgsVectorLayerSelectedFeatureSource & QgsVectorLayerSelectedFeatureSource::operator== ( const QgsVectorLayerSelectedFeatureSource other)
delete

◆ sourceCrs()

QgsCoordinateReferenceSystem QgsVectorLayerSelectedFeatureSource::sourceCrs ( ) const
overridevirtual

Returns the coordinate reference system for features in the source.

Implements QgsFeatureSource.

Definition at line 1328 of file qgsvectorlayerfeatureiterator.cpp.

◆ sourceName()

QString QgsVectorLayerSelectedFeatureSource::sourceName ( ) const
overridevirtual

Returns a friendly display name for the source.

The returned value can be an empty string.

Implements QgsFeatureSource.

Definition at line 1348 of file qgsvectorlayerfeatureiterator.cpp.

◆ wkbType()

QgsWkbTypes::Type QgsVectorLayerSelectedFeatureSource::wkbType ( ) const
overridevirtual

Returns the geometry type for features returned by this source.

Implements QgsFeatureSource.

Definition at line 1338 of file qgsvectorlayerfeatureiterator.cpp.


The documentation for this class was generated from the following files: