18#ifndef QGSVECTORLAYER_H
19#define QGSVECTORLAYER_H
48using namespace Qt::StringLiterals;
63class QgsGeometryVertexIndex;
558 QList<QgsVectorLayer *> handledLayers(
bool includeAuxiliaryLayers =
true )
const;
583 explicit QgsVectorLayer(
const QString &path = QString(),
const QString &baseName = QString(),
592 SIP_PYOBJECT __repr__();
594 QString str = u
"<QgsVectorLayer: '%1' (%2)>"_s.arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : u
"Invalid"_s );
595 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
693 void setProviderEncoding(
const QString &encoding );
696 void setCoordinateSystem();
709 bool removeJoin(
const QString &joinLayerId );
722 const QList<QgsVectorLayerJoinInfo> vectorJoins()
const;
731 bool setDependencies(
const QSet<QgsMapLayerDependency> &layers )
final;
750 int addExpressionField( const QString &exp, const
QgsField &fld );
758 void removeExpressionField(
int index );
768 QString expressionField(
int index ) const;
778 void updateExpressionField(
int index, const QString &exp );
800 int selectedFeatureCount()
const;
849 Q_INVOKABLE
void invertSelection();
852 Q_INVOKABLE
void selectAll();
861 Q_INVOKABLE
void invertSelectionInRectangle(
QgsRectangle &rect );
912 bool labelsEnabled()
const;
923 void setLabelsEnabled(
bool enabled );
929 bool diagramsEnabled()
const;
983 void removeFeatureRendererGenerator(
const QString &
id );
992 QList< const QgsFeatureRendererGenerator * > featureRendererGenerators()
const;
1001 QString sourceName() const final;
1013 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const final;
1015 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const final;
1016 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const final;
1021 void resolveReferences(
QgsProject *project ) final;
1035 bool loadAuxiliaryLayer( const
QgsAuxiliaryStorage &storage, const QString &key = QString() );
1059 bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
1061 bool readStyle( const QDomNode &node, QString &errorMessage,
1063 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1065 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1077 Q_DECL_DEPRECATED
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const
SIP_DEPRECATED;
1089 bool readSld( const QDomNode &node, QString &errorMessage ) final;
1096 long long featureCount( const QString &legendKey ) const;
1104 QgsFeatureIds symbolFeatureIds( const QString &legendKey ) const;
1116 Qgis::FeatureAvailability hasFeatures() const final;
1118 QString loadDefaultStyle(
bool &resultFlag
SIP_OUT ) final;
1141 virtual
bool setSubsetString( const QString &subset );
1147 virtual QString subsetString() const;
1224 Q_INVOKABLE
bool updateFeature(
QgsFeature &feature,
bool skipDefaultValues = false );
1237 bool insertVertex(
double x,
double y,
QgsFeatureId atFeatureId,
int beforeVertex );
1262 bool moveVertex(
double x,
double y,
QgsFeatureId atFeatureId,
int atVertex );
1294 Q_INVOKABLE
bool deleteSelectedFeatures(
int *deletedCount =
nullptr,
QgsVectorLayer::DeleteContext *context =
nullptr );
1427 Q_INVOKABLE
int translateFeature(
QgsFeatureId featureId,
double dx,
double dy );
1449 Q_DECL_DEPRECATED
Qgis::GeometryOperationResult splitParts( const QVector<
QgsPointXY> &splitLine,
bool topologicalEditing = false )
SIP_DEPRECATED;
1470 Q_INVOKABLE
Qgis::GeometryOperationResult splitParts( const
QgsPointSequence &splitLine,
bool topologicalEditing = false );
1492 Q_DECL_DEPRECATED
Qgis::GeometryOperationResult splitFeatures( const QVector<
QgsPointXY> &splitLine,
bool topologicalEditing = false )
SIP_DEPRECATED;
1513 Q_INVOKABLE
Qgis::GeometryOperationResult splitFeatures( const
QgsPointSequence &splitLine,
bool topologicalEditing = false );
1537 Q_INVOKABLE
Qgis::GeometryOperationResult splitFeatures( const
QgsCurve *curve,
QgsPointSequence &topologyTestPoints
SIP_OUT,
bool preserveCircular = false,
bool topologicalEditing = false );
1552 int addTopologicalPoints( const
QgsGeometry &geom );
1588 int addTopologicalPoints( const
QgsPoint &p );
1631 bool isSpatial() const final;
1634 bool isModified() const override;
1641 bool isAuxiliaryField(
int index,
int &srcIndex ) const;
1644 void reload() final;
1655 QgsBox3D sourceExtent3D() const final;
1688 bool setReadOnly(
bool readonly = true );
1695 Q_INVOKABLE
bool supportsEditing() const override;
1751 Q_INVOKABLE
bool changeAttributeValue(
QgsFeatureId fid,
int field, const QVariant &newValue, const QVariant &oldValue = QVariant(),
bool skipDefaultValues = false,
QgsVectorLayerToolsContext *context =
nullptr );
1800 Q_INVOKABLE
bool addAttribute( const
QgsField &field );
1806 Q_INVOKABLE
void setFieldAlias(
int index, const QString &aliasString );
1812 Q_INVOKABLE
void removeFieldAlias(
int index );
1823 Q_INVOKABLE
bool renameAttribute(
int index, const QString &newName );
1831 Q_INVOKABLE QString attributeAlias(
int index ) const;
1834 Q_INVOKABLE QString attributeDisplayName(
int index ) const;
1872 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1874 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1879 sipCpp->setFieldSplitPolicy( a0, a1 );
1892 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1894 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1899 sipCpp->setFieldDuplicatePolicy( a0, a1 );
1912 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1914 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1919 sipCpp->setFieldMergePolicy( a0, a1 );
1928 Q_DECL_DEPRECATED QSet<QString> excludeAttributesWms() const
SIP_DEPRECATED;
1934 Q_DECL_DEPRECATED
void setExcludeAttributesWms( const QSet<QString> &att )
SIP_DEPRECATED;
1940 Q_DECL_DEPRECATED QSet<QString> excludeAttributesWfs() const
SIP_DEPRECATED;
1946 Q_DECL_DEPRECATED
void setExcludeAttributesWfs( const QSet<QString> &att )
SIP_DEPRECATED;
1956 Q_INVOKABLE virtual
bool deleteAttribute(
int attr );
1965 Q_INVOKABLE
bool deleteAttributes( const QList<
int> &attrs );
1967 using QgsFeatureSink::addFeatures;
1968 bool addFeatures(
QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) final;
1980 Q_INVOKABLE
bool deleteFeature(
QgsFeatureId fid, QgsVectorLayer::DeleteContext *context =
nullptr );
1995 Q_INVOKABLE
bool deleteFeatures( const
QgsFeatureIds &fids, QgsVectorLayer::DeleteContext *context =
nullptr );
2020 Q_INVOKABLE
bool commitChanges(
bool stopEditing = true );
2027 QStringList commitErrors() const;
2038 Q_INVOKABLE
bool rollBack(
bool deleteBuffer = true );
2046 QList<QgsRelation> referencingRelations(
int idx ) const;
2057 QList<QgsWeakRelation> weakRelations() const
SIP_SKIP;
2067 void setWeakRelations( const QList< QgsWeakRelation > &relations )
SIP_SKIP;
2082 void beginEditCommand(
const QString &text );
2085 void endEditCommand();
2088 void destroyEditCommand();
2094 Q_DECL_DEPRECATED
static void drawVertexMarker(
double x,
double y, QPainter &p,
Qgis::VertexMarkerType type,
int vertexSize );
2104 void updateFields();
2132 void setDefaultValueDefinition(
int index,
const QgsDefaultValue &definition );
2157 QMap< QgsFieldConstraints::Constraint, QgsFieldConstraints::ConstraintStrength> fieldConstraintsAndStrength(
int fieldIndex )
const;
2182 QString constraintExpression(
int index )
const;
2190 QString constraintDescription(
int index )
const;
2199 void setConstraintExpression(
int index,
const QString &expression,
const QString &description = QString() );
2252 QSet<QVariant>
uniqueValues(
int fieldIndex,
int limit = -1 ) const final;
2267 QStringList uniqueStringsMatching(
int index, const QString &substring,
int limit = -1,
2284 QVariant minimumValue(
int index ) const final;
2300 QVariant maximumValue(
int index ) const final;
2322 void minimumAndMaximumValue(
int index, QVariant &minimum
SIP_OUT, QVariant &maximum
SIP_OUT ) const;
2337 QVariant aggregate(
Qgis::Aggregate aggregate,
2338 const QString &fieldOrExpression,
2347 void setFeatureBlendMode( QPainter::CompositionMode blendMode );
2349 QPainter::CompositionMode featureBlendMode() const;
2351 QString htmlMetadata() const final;
2414 void setReadExtentFromXml(
bool readExtentFromXml );
2422 bool readExtentFromXml() const;
2473 void setAllowCommit(
bool allowCommit )
SIP_SKIP;
2518 Q_INVOKABLE
void deselect(
const QgsFeatureIds &featureIds );
2526 Q_INVOKABLE
void removeSelection();
2546 virtual void updateExtents(
bool force =
false );
2562 Q_INVOKABLE
bool startEditing();
2826 void invalidateSymbolCountedFlag();
2827 void onFeatureCounterCompleted();
2828 void onFeatureCounterTerminated();
2829 void onJoinedFieldsChanged();
2832 void onRelationsLoaded();
2833 void onSymbolsCounted();
2834 void onDirtyTransaction(
const QString &sql,
const QString &
name );
2835 void emitDataChanged();
2849 bool isReadOnly() const final;
2857 bool setDataProvider( QString const &provider, const
QgsDataProvider::ProviderOptions &options,
Qgis::DataProviderReadFlags
flags =
Qgis::DataProviderReadFlags() );
2870 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const
QgsDataProvider::ProviderOptions &options,
Qgis::DataProviderReadFlags
flags ) override;
2873 void readSldLabeling( const QDomNode &node );
2887 void minimumOrMaximumValue(
int index, QVariant *minimum, QVariant *maximum )
const;
2889 void createEditBuffer();
2890 void clearEditBuffer();
2899 QString mDisplayExpression;
2905 bool mDataSourceReadOnly =
false;
2913 bool mReadOnly =
false;
2934 QMap<QString, QgsDefaultValue> mDefaultExpressionMap;
2937 QMap< QString, Qgis::FieldDomainSplitPolicy > mAttributeSplitPolicy;
2940 QMap< QString, Qgis::FieldDuplicatePolicy > mAttributeDuplicatePolicy;
2943 QMap< QString, Qgis::FieldDomainMergePolicy > mAttributeMergePolicy;
2946 QSet<int> mDefaultValueOnUpdateFields;
2949 QMap< QString, QgsFieldConstraints::Constraints > mFieldConstraints;
2955 QMap< QString, QPair< QString, QString > > mFieldConstraintExpressions;
2957 QMap< QString, Qgis::FieldConfigurationFlags > mFieldConfigurationFlags;
2958 QMap< QString, QgsEditorWidgetSetup > mFieldWidgetSetups;
2976 bool mLabelsEnabled =
false;
2979 bool mLabelFontNotFoundNotified =
false;
2982 QPainter::CompositionMode mFeatureBlendMode = QPainter::CompositionMode_SourceOver;
2985 bool mVertexMarkerOnlyForSelection =
false;
2987 QStringList mCommitErrors;
3007 mutable bool mValidExtent2D =
false;
3008 mutable bool mLazyExtent2D =
true;
3009 mutable bool mValidExtent3D =
false;
3010 mutable bool mLazyExtent3D =
true;
3013 std::unique_ptr<QgsAuxiliaryLayer> mAuxiliaryLayer;
3016 QString mAuxiliaryLayerKey;
3019 bool mSymbolFeatureCounted =
false;
3022 QHash<QString, long long> mSymbolFeatureCountMap;
3023 QHash<QString, QgsFeatureIds> mSymbolFeatureIdMap;
3026 bool mEditCommandActive =
false;
3029 bool mCommitChangesActive =
false;
3031 bool mReadExtentFromXml;
3039 mutable QMutex mFeatureSourceConstructorMutex;
3043 std::unique_ptr<QgsGeometryOptions> mGeometryOptions;
3045 bool mAllowCommit =
true;
3053 bool mDataChangedFired =
false;
3055 QList<QgsWeakRelation> mWeakRelations;
3057 bool mSetLegendFromStyle =
false;
3059 QList< QgsFeatureRendererGenerator * > mRendererGenerators;
3062 QTimer *mRefreshRendererTimer =
nullptr;
3067 bool mLoadAllStoredStyle =
false;
Provides global constants and enumerations for use throughout the application.
SpatialIndexPresence
Enumeration of spatial index presence states.
VectorRenderingSimplificationFlag
Simplification flags for vector feature rendering.
FieldDomainMergePolicy
Merge policy for field domains.
FieldDomainSplitPolicy
Split policy for field domains.
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
FieldDuplicatePolicy
Duplicate policy for fields.
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
WkbType
The WKB type describes the number of dimensions a geometry has.
FieldConfigurationFlag
Configuration flags for fields These flags are meant to be user-configurable and are not describing a...
QFlags< FieldConfigurationFlag > FieldConfigurationFlags
Configuration flags for fields These flags are meant to be user-configurable and are not describing a...
SelectBehavior
Specifies how a selection should be applied.
@ SetSelection
Set selection, removing any existing selection.
Abstract base class for simplifying geometries using a specific algorithm.
Abstract base class for objects which generate elevation profiles.
Interface for classes which can generate elevation profiles.
virtual QgsAbstractProfileGenerator * createProfileGenerator(const QgsProfileRequest &request)=0
Given a profile request, returns a new profile generator ready for generating elevation profiles.
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
Storage and management of actions associated with a layer.
Utility class for calculating aggregates for a field (or expression) over the features from a vector ...
A container for configuration of the attribute table.
Allows managing the auxiliary storage for a vector layer.
Providing some utility methods to manage auxiliary storage.
A 3-dimensional box composed of x, y, z coordinates.
Holds conditional style information for a layer.
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Abstract base class for curved geometry type.
Abstract base class for spatial data provider implementations.
Provides a container for managing client side default values for fields.
Stores the settings for rendering of all diagrams for a layer.
Evaluates and returns the diagram settings relating to a diagram for a specific feature.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Abstract interface for generating an expression context scope.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Buffers information about expression fields for a vector layer.
Wrapper for iterator of features from vector data provider or vector layer.
bool nextFeature(QgsFeature &f)
Fetch next feature and stores in f, returns true on success.
An interface for objects which generate feature renderers for vector layers.
Abstract base class for all 2D vector feature renderers.
Wraps a request for features to a vector layer (or directly its vector data provider).
An interface for objects which accept features via addFeature(s) methods.
virtual bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags())
Adds a single feature to the sink.
An interface for objects which provide features via a getFeatures method.
virtual QSet< QVariant > uniqueValues(int fieldIndex, int limit=-1) const
Returns the set of unique values contained within the specified fieldIndex from this source.
virtual Qgis::WkbType wkbType() const =0
Returns the geometry type for features returned by this source.
virtual Qgis::SpatialIndexPresence hasSpatialIndex() const
Returns an enum value representing the presence of a valid spatial index on the source,...
virtual QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const =0
Returns an iterator for the features in the source.
virtual long long featureCount() const =0
Returns the number of features contained in the source, or -1 if the feature count is unknown.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for feedback objects to be used for cancellation of something running in a worker thread.
ConstraintStrength
Strength of constraints.
@ ConstraintStrengthHard
Constraint must be honored before feature can be accepted.
Constraint
Constraints which may be present on a field.
QFlags< Constraint > Constraints
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
Contains options to automatically adjust geometries to constraints on a layer.
A geometry is the spatial representation of a feature.
Base class for storage of map layer elevation properties.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Base class for storage of map layer selection properties.
Base class for storage of map layer temporal properties.
Base class for all map layer types.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the layer.
virtual bool setDependencies(const QSet< QgsMapLayerDependency > &layers)
Sets the list of dependencies.
virtual void setExtent3D(const QgsBox3D &box)
Sets the extent.
virtual QSet< QgsMapLayerDependency > dependencies() const
Gets the list of dependencies.
friend class QgsVectorLayer
QgsMapLayer(Qgis::LayerType type=Qgis::LayerType::Vector, const QString &name=QString(), const QString &source=QString())
Constructor for QgsMapLayer.
QPainter::CompositionMode blendMode() const
Returns the current blending mode for a layer.
virtual bool isEditable() const
Returns true if the layer can be edited.
QgsMapLayer::LayerFlags flags
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
virtual void setExtent(const QgsRectangle &rect)
Sets the extent.
virtual void setTransformContext(const QgsCoordinateTransformContext &transformContext)=0
Sets the coordinate transform context to transformContext.
Perform transforms between map coordinates and device coordinates.
An interface for classes which can visit various object entity (e.g.
A QgsObjectEntityVisitorInterface context object.
Contains settings for how a map layer will be labeled.
Point geometry type, with support for z-dimension and m-values.
Encapsulates properties and constraints relating to fetching elevation profiles from different source...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
A container for the context for various read/write operations on objects.
A rectangle specified with double values.
Manages a set of relations between layers.
Represents a relationship between two vector layers.
Contains information about the context of a rendering operation.
A boolean settings entry.
A template class for enum and flag settings entry.
A feature renderer which renders all features with the same symbol.
Holds SLD export options and other information related to SLD export of a QGIS layer style.
Manages stored expressions regarding creation, modification and storing in the project.
An interface for classes which can visit style entity (e.g.
Abstract base class for all rendered symbols.
Base class for vector data providers.
Stores queued vector layer edit operations prior to committing changes to the layer's data provider.
Vector layer specific subclass of QgsMapLayerElevationProperties.
Counts the features in a QgsVectorLayer in task.
Manages joined fields for a vector layer.
Defines left outer join from our vector layer to some other vector layer.
Implementation of layer selection properties for vector layers.
Implementation of map layer temporal properties for vector layers.
Contains settings which reflect the context in which vector layer tool operations should be considere...
Represents a vector layer which manages a vector based dataset.
void committedFeaturesAdded(const QString &layerId, const QgsFeatureList &addedFeatures)
Emitted when features are added to the provider if not in transaction mode.
static const QgsSettingsEntryEnumFlag< Qgis::VectorRenderingSimplificationFlags > * settingsSimplifyDrawingHints
void labelingFontNotFound(QgsVectorLayer *layer, const QString &fontfamily)
Emitted when the font family defined for labeling layer is not found on system.
void featureBlendModeChanged(QPainter::CompositionMode blendMode)
Signal emitted when setFeatureBlendMode() is called.
Q_INVOKABLE QgsAttributeList attributeList() const
Returns list of attribute indexes.
void beforeRemovingExpressionField(int idx)
Will be emitted, when an expression field is going to be deleted from this vector layer.
void committedGeometriesChanges(const QString &layerId, const QgsGeometryMap &changedGeometries)
Emitted when geometry changes are saved to the provider if not in transaction mode.
void beforeCommitChanges(bool stopEditing)
Emitted before changes are committed to the data provider.
QgsVectorLayer(const QString &path=QString(), const QString &baseName=QString(), const QString &providerLib="ogr", const QgsVectorLayer::LayerOptions &options=QgsVectorLayer::LayerOptions())
Constructor - creates a vector layer.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
void attributeAdded(int idx)
Will be emitted, when a new attribute has been added to this vector layer.
QString capabilitiesString() const
Capabilities for this layer, comma separated and translated.
QgsAbstractVectorLayerLabeling * labeling()
Access to labeling configuration.
void allowCommitChanged()
Emitted whenever the allowCommit() property of this layer changes.
friend class QgsVectorLayerEditBuffer
void editCommandStarted(const QString &text)
Signal emitted when a new edit command has been started.
const QgsDiagramLayerSettings * diagramLayerSettings() const
const QgsVectorLayerJoinBuffer * joinBuffer() const
Returns a const pointer on join buffer object.
friend class QgsVectorLayerEditPassthrough
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Sets the simplification settings for fast rendering of features.
void editCommandDestroyed()
Signal emitted, when an edit command is destroyed.
static const QgsSettingsEntryEnumFlag< Qgis::VectorSimplificationAlgorithm > * settingsSimplifyAlgorithm
QgsVectorLayer(const QgsVectorLayer &rhs)=delete
void featuresDeleted(const QgsFeatureIds &fids)
Emitted when features have been deleted.
Qgis::VectorLayerTypeFlags vectorLayerTypeFlags() const
Returns the vector layer type flags.
void subsetStringChanged()
Emitted when the layer's subset string has changed.
void committedFeaturesRemoved(const QString &layerId, const QgsFeatureIds &deletedFeatureIds)
Emitted when features are deleted from the provider if not in transaction mode.
static const QgsSettingsEntryDouble * settingsSimplifyMaxScale
bool hasMapTips() const final
Returns true if the layer contains map tips.
QgsStoredExpressionManager * storedExpressionManager()
Returns the manager of the stored expressions for this layer.
void symbolFeatureCountMapChanged()
Emitted when the feature count for symbols on this layer has been recalculated.
bool isEditCommandActive() const
Tests if an edit command is active.
void writeCustomSymbology(QDomElement &element, QDomDocument &doc, QString &errorMessage) const
Signal emitted whenever the symbology (QML-file) for this layer is being written.
const QgsAbstractVectorLayerLabeling * labeling() const
Access to const labeling configuration.
void setDisplayExpression(const QString &displayExpression)
Set the preview expression, used to create a human readable preview string.
static const QgsSettingsEntryBool * settingsSimplifyLocal
QgsMapLayerElevationProperties * elevationProperties() override
Returns the layer's elevation properties.
QString storageType() const
Returns the permanent storage type for this layer as a friendly name.
QString dataComment() const
Returns a description for this layer as defined in the data provider.
void attributeDeleted(int idx)
Will be emitted, when an attribute has been deleted from this vector layer.
QgsVectorLayer & operator=(QgsVectorLayer const &rhs)=delete
QgsFeatureRenderer * renderer()
Returns the feature renderer used for rendering the features in the layer in 2D map views.
void beforeEditingStarted()
Emitted before editing on this layer is started.
void committedAttributeValuesChanges(const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues)
Emitted when attribute value changes are saved to the provider if not in transaction mode.
void committedAttributesAdded(const QString &layerId, const QList< QgsField > &addedAttributes)
Emitted when attributes are added to the provider if not in transaction mode.
Q_INVOKABLE QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
void setEditFormConfig(const QgsEditFormConfig &editFormConfig)
Sets the editFormConfig (configuration) of the form used to represent this vector layer.
void committedAttributesDeleted(const QString &layerId, const QgsAttributeList &deletedAttributes)
Emitted when attributes are deleted from the provider if not in transaction mode.
QString displayExpression
void displayExpressionChanged()
Emitted when the display expression changes.
QString profileSourceId() const override
Returns a unique identifier for this profile source.
const QgsActionManager * actions() const
Returns all layer actions defined on this layer.
bool setReadOnly(bool readonly=true)
Makes layer read-only (editing disabled) or not.
void editFormConfigChanged()
Will be emitted whenever the edit form configuration of this layer changes.
QgsVectorLayerJoinBuffer * joinBuffer()
Returns the join buffer object.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const final
Queries the layer for features specified in request.
void afterCommitChanges()
Emitted after changes are committed to the data provider.
QgsActionManager * actions()
Returns all layer actions defined on this layer.
void raiseError(const QString &msg)
Signals an error related to this vector layer.
void editCommandEnded()
Signal emitted, when an edit command successfully ended.
void supportsEditingChanged()
Emitted when the read only state or the data provider of this layer is changed.
void readOnlyChanged()
Emitted when the read only state of this layer is changed.
void attributeValueChanged(QgsFeatureId fid, int idx, const QVariant &value)
Emitted whenever an attribute value change is done in the edit buffer.
QgsFeatureIterator getFeatures(const QgsFeatureIds &fids)
Queries the layer for the features with the given ids.
friend class QgsVectorLayerFeatureSource
virtual bool setSubsetString(const QString &subset)
Sets the string (typically sql) used to define a subset of the layer.
void afterRollBack()
Emitted after changes are rolled back.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
void selectionChanged(const QgsFeatureIds &selected, const QgsFeatureIds &deselected, bool clearAndSelect)
Emitted when selection was changed.
void beforeAddingExpressionField(const QString &fieldName)
Will be emitted, when an expression field is going to be added to this vector layer.
void updatedFields()
Emitted whenever the fields available from this layer have been changed.
void featureAdded(QgsFeatureId fid)
Emitted when a new feature has been added to the layer.
void featureDeleted(QgsFeatureId fid)
Emitted when a feature has been deleted.
void readCustomSymbology(const QDomElement &element, QString &errorMessage)
Signal emitted whenever the symbology (QML-file) for this layer is being read.
QString profileSourceName() const override
Returns a name for displaying this profile source in the elevation profile layer tree.
const QgsVectorLayerEditBuffer * editBuffer() const
Buffer with uncommitted editing operations.
bool isSqlQuery() const
Returns true if the layer is a query (SQL) layer.
void beforeRollBack()
Emitted before changes are rolled back.
QgsAbstractProfileSource * profileSource() override
Returns the layer's profile source if it has profile capabilities.
QString displayField() const
This is a shorthand for accessing the displayExpression if it is a simple field.
void geometryChanged(QgsFeatureId fid, const QgsGeometry &geometry)
Emitted whenever a geometry change is done in the edit buffer.
QgsFeatureIterator getFeatures(const QgsRectangle &rectangle)
Queries the layer for the features which intersect the specified rectangle.
QgsEditFormConfig editFormConfig
const QgsFeatureRenderer * renderer() const
Returns the feature renderer used for rendering the features in the layer in 2D map views.
void beforeModifiedCheck() const
Emitted when the layer is checked for modifications. Use for last-minute additions.
Q_INVOKABLE QgsFeature getFeature(QgsFeatureId fid) const
Queries the layer for the feature with the given id.
const QgsDiagramRenderer * diagramRenderer() const
QgsMapLayerSelectionProperties * selectionProperties() override
Returns the layer's selection properties.
QgsVectorDataProvider * dataProvider() final
Returns the layer's data provider, it may be nullptr.
static const QgsSettingsEntryDouble * settingsSimplifyDrawingTol
friend class QgsVectorLayerEditBufferGroup
Contains settings for simplifying geometries fetched from a vector layer.
Represent a QgsRelation with possibly unresolved layers or unmatched fields.
QMap< QString, QString > QgsStringMap
QVector< QgsPoint > QgsPointSequence
QMap< int, QVariant > QgsAttributeMap
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
QList< QgsFeature > QgsFeatureList
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
QList< int > QgsAttributeList
QSet< int > QgsAttributeIds
QList< int > QgsAttributeList
Context for cascade delete features.
DeleteContext(bool cascade=false, QgsProject *project=nullptr)
Constructor for DeleteContext.
QMap< QgsVectorLayer *, QgsFeatureIds > mHandledFeatures
Setting options for loading vector layers.
bool readExtentFromXml
If true, the layer extent will be read from XML (i.e.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
LayerOptions(bool loadDefaultStyle=true, bool readExtentFromXml=false)
Constructor for LayerOptions.
bool forceReadOnly
Controls whether the layer is forced to be load as Read Only.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
LayerOptions(const QgsCoordinateTransformContext &transformContext, bool loadDefaultStyle=true, bool readExtentFromXml=false)
Constructor for LayerOptions.
QgsCoordinateReferenceSystem fallbackCrs
Fallback layer coordinate reference system.
Qgis::WkbType fallbackWkbType
Fallback geometry type.
bool loadAllStoredStyles
Controls whether the stored styles will be all loaded.