QGIS API Documentation 3.43.0-Master (69d1901085b)
qgsvectorlayer.h
Go to the documentation of this file.
1
2/***************************************************************************
3 -------------------
4 begin : Oct 29, 2003
5 copyright : (C) 2003 by Gary E.Sherman
6 email : sherman at mrcc.com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSVECTORLAYER_H
19#define QGSVECTORLAYER_H
20
21#include "qgis_core.h"
22#include <QMap>
23#include <QSet>
24#include <QList>
25#include <QStringList>
26#include <QFont>
27#include <QMutex>
28
29#include "qgis.h"
30#include "qgsmaplayer.h"
31#include "qgsfeature.h"
32#include "qgsfeaturerequest.h"
33#include "qgsfeaturesource.h"
34#include "qgsfields.h"
37#include "qgseditformconfig.h"
40#include "qgsfeatureiterator.h"
46
47class QPainter;
48class QImage;
49
53class QgsCurve;
59class QgsGeometry;
60class QgsGeometryVertexIndex;
61class QgsMapToPixel;
62class QgsRectangle;
63class QgsRectangle;
64class QgsRelation;
65class QgsWeakRelation;
69class QgsSymbol;
76class QgsPoint;
77class QgsFeedback;
86
87#ifndef SIP_RUN
88template<class T>
90#endif
93
94
95typedef QList<int> QgsAttributeList;
96typedef QSet<int> QgsAttributeIds;
97
98// TODO QGIS4: Remove virtual from non-inherited methods (like isModified)
99
402{
403 Q_OBJECT
404
405 Q_PROPERTY( QString subsetString READ subsetString WRITE setSubsetString NOTIFY subsetStringChanged )
406 Q_PROPERTY( QString displayExpression READ displayExpression WRITE setDisplayExpression NOTIFY displayExpressionChanged )
407 Q_PROPERTY( QgsEditFormConfig editFormConfig READ editFormConfig WRITE setEditFormConfig NOTIFY editFormConfigChanged )
408 Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged )
409 Q_PROPERTY( bool supportsEditing READ supportsEditing NOTIFY supportsEditingChanged )
410 Q_PROPERTY( QgsFields fields READ fields NOTIFY updatedFields )
411
412 public:
413
414 static const QgsSettingsEntryBool *settingsSimplifyLocal SIP_SKIP;
415
416 static const QgsSettingsEntryDouble *settingsSimplifyMaxScale SIP_SKIP;
417 static const QgsSettingsEntryDouble *settingsSimplifyDrawingTol SIP_SKIP;
418 static const QgsSettingsEntryEnumFlag<Qgis::VectorSimplificationAlgorithm> *settingsSimplifyAlgorithm SIP_SKIP;
419 static const QgsSettingsEntryEnumFlag<Qgis::VectorRenderingSimplificationFlags> *settingsSimplifyDrawingHints SIP_SKIP;
420
425 {
426
430 explicit LayerOptions( bool loadDefaultStyle = true,
431 bool readExtentFromXml = false )
432 : loadDefaultStyle( loadDefaultStyle )
433 , readExtentFromXml( readExtentFromXml )
434 {}
435
440 explicit LayerOptions( const QgsCoordinateTransformContext &transformContext,
441 bool loadDefaultStyle = true,
442 bool readExtentFromXml = false
443 )
444 : loadDefaultStyle( loadDefaultStyle )
445 , readExtentFromXml( readExtentFromXml )
446 , transformContext( transformContext )
447 {}
448
450 bool loadDefaultStyle = true;
451
456 bool readExtentFromXml = false;
457
463
476
489
503 bool skipCrsValidation = false;
504
516 bool forceReadOnly = false;
517
530 bool loadAllStoredStyles = false;
531 };
532
537 struct CORE_EXPORT DeleteContext
538 {
539
543 explicit DeleteContext( bool cascade = false, QgsProject *project = nullptr ): cascade( cascade ), project( project ) {}
544
551 QList<QgsVectorLayer *> handledLayers( bool includeAuxiliaryLayers = true ) const;
552
556 QgsFeatureIds handledFeatures( QgsVectorLayer *layer ) const;
557
558 QMap<QgsVectorLayer *, QgsFeatureIds> mHandledFeatures SIP_SKIP;
561 };
562
576 explicit QgsVectorLayer( const QString &path = QString(), const QString &baseName = QString(),
577 const QString &providerLib = "ogr", const QgsVectorLayer::LayerOptions &options = QgsVectorLayer::LayerOptions() );
578
579 ~QgsVectorLayer() override;
580
581 QgsVectorLayer( const QgsVectorLayer &rhs ) = delete;
582 QgsVectorLayer &operator=( QgsVectorLayer const &rhs ) = delete;
583
584#ifdef SIP_RUN
585 SIP_PYOBJECT __repr__();
586 % MethodCode
587 QString str = QStringLiteral( "<QgsVectorLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
588 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
589 % End
590#endif
591
599 QgsVectorLayer *clone() const override SIP_FACTORY;
600
605 QString storageType() const;
606
610 QString capabilitiesString() const;
611
612
622 bool isSqlQuery() const;
623
630 Qgis::VectorLayerTypeFlags vectorLayerTypeFlags() const;
631
632
636 QString dataComment() const;
637
645 QString displayField() const;
646
654 void setDisplayExpression( const QString &displayExpression );
655
662 QString displayExpression() const;
663
664 bool hasMapTips() const FINAL;
665
666 QgsVectorDataProvider *dataProvider() FINAL;
667 const QgsVectorDataProvider *dataProvider() const FINAL SIP_SKIP;
668 QgsMapLayerSelectionProperties *selectionProperties() override;
669 QgsMapLayerTemporalProperties *temporalProperties() override;
670 QgsMapLayerElevationProperties *elevationProperties() override;
671 QgsAbstractProfileGenerator *createProfileGenerator( const QgsProfileRequest &request ) override SIP_FACTORY;
672
683 void setProviderEncoding( const QString &encoding );
684
686 void setCoordinateSystem();
687
693 bool addJoin( const QgsVectorLayerJoinInfo &joinInfo );
694
699 bool removeJoin( const QString &joinLayerId );
700
704 QgsVectorLayerJoinBuffer *joinBuffer() { return mJoinBuffer; }
705
710 const QgsVectorLayerJoinBuffer *joinBuffer() const { return mJoinBuffer; } SIP_SKIP;
711
712 const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
713
721 bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) FINAL;
722
729 QSet<QgsMapLayerDependency> dependencies() const FINAL;
730
740 int addExpressionField( const QString &exp, const QgsField &fld );
741
748 void removeExpressionField( int index );
749
758 QString expressionField( int index ) const;
759
768 void updateExpressionField( int index, const QString &exp );
769
776 QgsActionManager *actions() { return mActions; }
777
783 const QgsActionManager *actions() const SIP_SKIP { return mActions; }
784
790 int selectedFeatureCount() const;
791
801 Q_INVOKABLE void selectByRect( QgsRectangle &rect, Qgis::SelectBehavior behavior = Qgis::SelectBehavior::SetSelection );
802
812 Q_INVOKABLE void selectByExpression( const QString &expression, Qgis::SelectBehavior behavior = Qgis::SelectBehavior::SetSelection, QgsExpressionContext *context = nullptr );
813
823 Q_INVOKABLE void selectByIds( const QgsFeatureIds &ids, Qgis::SelectBehavior behavior = Qgis::SelectBehavior::SetSelection );
824
836 Q_INVOKABLE void modifySelection( const QgsFeatureIds &selectIds, const QgsFeatureIds &deselectIds );
837
839 Q_INVOKABLE void invertSelection();
840
842 Q_INVOKABLE void selectAll();
843
851 Q_INVOKABLE void invertSelectionInRectangle( QgsRectangle &rect );
852
865 Q_INVOKABLE QgsFeatureList selectedFeatures() const;
866
882 QgsFeatureIterator getSelectedFeatures( QgsFeatureRequest request = QgsFeatureRequest() ) const;
883
891 Q_INVOKABLE const QgsFeatureIds &selectedFeatureIds() const;
892
894 Q_INVOKABLE QgsRectangle boundingBoxOfSelected() const;
895
902 bool labelsEnabled() const;
903
913 void setLabelsEnabled( bool enabled );
914
919 bool diagramsEnabled() const;
920
922 void setDiagramRenderer( QgsDiagramRenderer *r SIP_TRANSFER );
923 const QgsDiagramRenderer *diagramRenderer() const { return mDiagramRenderer; }
924
925 void setDiagramLayerSettings( const QgsDiagramLayerSettings &s );
926 const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
927
934 QgsFeatureRenderer *renderer() { return mRenderer; }
935
943 const QgsFeatureRenderer *renderer() const SIP_SKIP { return mRenderer; }
944
951 void setRenderer( QgsFeatureRenderer *r SIP_TRANSFER );
952
962 void addFeatureRendererGenerator( QgsFeatureRendererGenerator *generator SIP_TRANSFER );
963
973 void removeFeatureRendererGenerator( const QString &id );
974
982 QList< const QgsFeatureRendererGenerator * > featureRendererGenerators() const;
983
985 Q_INVOKABLE Qgis::GeometryType geometryType() const;
986
988 Q_INVOKABLE Qgis::WkbType wkbType() const FINAL;
989
990 QgsCoordinateReferenceSystem sourceCrs() const FINAL;
991 QString sourceName() const FINAL;
992
997 bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) FINAL;
998
1003 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const FINAL;
1004
1005 QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const FINAL;
1006 QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const FINAL;
1007
1011 void resolveReferences( QgsProject *project ) FINAL;
1012
1025 bool loadAuxiliaryLayer( const QgsAuxiliaryStorage &storage, const QString &key = QString() );
1026
1035 void setAuxiliaryLayer( QgsAuxiliaryLayer *layer SIP_TRANSFER = nullptr );
1036
1041 QgsAuxiliaryLayer *auxiliaryLayer();
1042
1047 const QgsAuxiliaryLayer *auxiliaryLayer() const SIP_SKIP;
1048
1049 bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
1050 QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1051 bool readStyle( const QDomNode &node, QString &errorMessage,
1052 QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1053 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1054 const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
1055 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1056 const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
1057
1067 Q_DECL_DEPRECATED bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const SIP_DEPRECATED;
1068
1077 bool writeSld( QDomNode &node, QDomDocument &doc, QgsSldExportContext &context ) const;
1078
1079 bool readSld( const QDomNode &node, QString &errorMessage ) FINAL;
1080
1086 long long featureCount( const QString &legendKey ) const;
1087
1094 QgsFeatureIds symbolFeatureIds( const QString &legendKey ) const;
1095
1106 Qgis::FeatureAvailability hasFeatures() const FINAL;
1107
1108 QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
1109
1122 QgsVectorLayerFeatureCounter *countSymbolFeatures( bool storeSymbolFids = false );
1123
1131 virtual bool setSubsetString( const QString &subset );
1132
1137 virtual QString subsetString() const;
1138
1144 QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const FINAL;
1145
1149 inline QgsFeatureIterator getFeatures( const QString &expression )
1150 {
1151 return getFeatures( QgsFeatureRequest( expression ) );
1152 }
1153
1158 Q_INVOKABLE inline QgsFeature getFeature( QgsFeatureId fid ) const
1159 {
1160 QgsFeature feature;
1161 getFeatures( QgsFeatureRequest( fid ) ).nextFeature( feature );
1162 return feature;
1163 }
1164
1169 QgsGeometry getGeometry( QgsFeatureId fid ) const;
1170
1175 {
1176 return getFeatures( QgsFeatureRequest( fids ) );
1177 }
1178
1183 {
1184 return getFeatures( QgsFeatureRequest( rectangle ) );
1185 }
1186
1188
1214 bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
1215
1227 bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
1228
1240 bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
1241
1252 bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
1253
1264 bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) SIP_PYNAME( moveVertexV2 );
1265
1275 Qgis::VectorEditResult deleteVertex( QgsFeatureId featureId, int vertex );
1276
1284 Q_INVOKABLE bool deleteSelectedFeatures( int *deletedCount = nullptr, QgsVectorLayer::DeleteContext *context = nullptr );
1285
1306 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addRing( const QVector<QgsPointXY> &ring, QgsFeatureId *featureId = nullptr ) SIP_DEPRECATED;
1307
1308
1328 Q_INVOKABLE Qgis::GeometryOperationResult addRing( const QgsPointSequence &ring, QgsFeatureId *featureId = nullptr );
1329
1350 Q_INVOKABLE Qgis::GeometryOperationResult addRing( QgsCurve *ring SIP_TRANSFER, QgsFeatureId *featureId = nullptr ) SIP_PYNAME( addCurvedRing );
1351
1371 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addPart( const QList<QgsPointXY> &ring ) SIP_DEPRECATED;
1372
1373#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1374
1395 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addPart( const QVector<QgsPointXY> &ring ) SIP_PYNAME( addPartV2 ) SIP_DEPRECATED;
1396#endif
1397
1417 Q_INVOKABLE Qgis::GeometryOperationResult addPart( const QgsPointSequence &ring ) SIP_PYNAME( addPartV2 );
1418
1429 Q_INVOKABLE Qgis::GeometryOperationResult addPart( QgsCurve *ring SIP_TRANSFER ) SIP_PYNAME( addCurvedPart );
1430
1442 Q_INVOKABLE int translateFeature( QgsFeatureId featureId, double dx, double dy );
1443
1464 Q_DECL_DEPRECATED Qgis::GeometryOperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
1465
1485 Q_INVOKABLE Qgis::GeometryOperationResult splitParts( const QgsPointSequence &splitLine, bool topologicalEditing = false );
1486
1507 Q_DECL_DEPRECATED Qgis::GeometryOperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
1508
1528 Q_INVOKABLE Qgis::GeometryOperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false );
1529
1552 Q_INVOKABLE Qgis::GeometryOperationResult splitFeatures( const QgsCurve *curve, QgsPointSequence &topologyTestPoints SIP_OUT, bool preserveCircular = false, bool topologicalEditing = false );
1553
1567 int addTopologicalPoints( const QgsGeometry &geom );
1568
1585 Q_DECL_DEPRECATED int addTopologicalPoints( const QgsPointXY &p ) SIP_DEPRECATED;
1586
1603 int addTopologicalPoints( const QgsPoint &p );
1604
1621 int addTopologicalPoints( const QgsPointSequence &ps );
1622
1628 const QgsAbstractVectorLayerLabeling *labeling() const SIP_SKIP { return mLabeling; }
1629
1636
1640 void setLabeling( QgsAbstractVectorLayerLabeling *labeling SIP_TRANSFER );
1641
1643 bool isEditable() const FINAL;
1644
1646 bool isSpatial() const FINAL;
1647
1649 bool isModified() const override;
1650
1656 bool isAuxiliaryField( int index, int &srcIndex ) const;
1657
1659 void reload() FINAL;
1660
1664 QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) FINAL SIP_FACTORY;
1665
1666 QgsRectangle extent() const FINAL;
1667 QgsRectangle sourceExtent() const FINAL;
1668
1669 QgsBox3D extent3D() const FINAL;
1670 QgsBox3D sourceExtent3D() const FINAL;
1671
1678 QgsFields fields() const FINAL;
1679
1683 Q_INVOKABLE inline QgsAttributeList attributeList() const { return mFields.allAttributesList(); }
1684
1688 QgsAttributeList primaryKeyAttributes() const;
1689
1695 long long featureCount() const FINAL;
1696
1703 bool setReadOnly( bool readonly = true );
1704
1710 bool supportsEditing() const override;
1711
1732 bool changeGeometry( QgsFeatureId fid, QgsGeometry &geometry, bool skipDefaultValue = false );
1733
1766 Q_INVOKABLE bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant(), bool skipDefaultValues = false, QgsVectorLayerToolsContext *context = nullptr );
1767
1804 Q_INVOKABLE bool changeAttributeValues( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap(), bool skipDefaultValues = false, QgsVectorLayerToolsContext *context = nullptr );
1805
1815 bool addAttribute( const QgsField &field );
1816
1821 void setFieldAlias( int index, const QString &aliasString );
1822
1827 void removeFieldAlias( int index );
1828
1838 bool renameAttribute( int index, const QString &newName );
1839
1846 QString attributeAlias( int index ) const;
1847
1849 QString attributeDisplayName( int index ) const;
1850
1852 QgsStringMap attributeAliases() const;
1853
1854#ifndef SIP_RUN
1855
1861 void setFieldSplitPolicy( int index, Qgis::FieldDomainSplitPolicy policy );
1862
1868 void setFieldDuplicatePolicy( int index, Qgis::FieldDuplicatePolicy policy );
1869
1875 void setFieldMergePolicy( int index, Qgis::FieldDomainMergePolicy policy );
1876#else
1877
1884 void setFieldSplitPolicy( int index, Qgis::FieldDomainSplitPolicy policy );
1885
1886 % MethodCode
1887 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1888 {
1889 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1890 sipIsErr = 1;
1891 }
1892 else
1893 {
1894 sipCpp->setFieldSplitPolicy( a0, a1 );
1895 }
1896 % End
1897
1904 void setFieldDuplicatePolicy( int index, Qgis::FieldDuplicatePolicy policy );
1905
1906 % MethodCode
1907 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1908 {
1909 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1910 sipIsErr = 1;
1911 }
1912 else
1913 {
1914 sipCpp->setFieldDuplicatePolicy( a0, a1 );
1915 }
1916 % End
1917
1924 void setFieldMergePolicy( int index, Qgis::FieldDomainMergePolicy policy );
1925
1926 % MethodCode
1927 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1928 {
1929 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1930 sipIsErr = 1;
1931 }
1932 else
1933 {
1934 sipCpp->setFieldMergePolicy( a0, a1 );
1935 }
1936 % End
1937#endif
1938
1943 Q_DECL_DEPRECATED QSet<QString> excludeAttributesWms() const SIP_DEPRECATED;
1944
1949 Q_DECL_DEPRECATED void setExcludeAttributesWms( const QSet<QString> &att ) SIP_DEPRECATED;
1950
1955 Q_DECL_DEPRECATED QSet<QString> excludeAttributesWfs() const SIP_DEPRECATED;
1956
1961 Q_DECL_DEPRECATED void setExcludeAttributesWfs( const QSet<QString> &att ) SIP_DEPRECATED;
1962
1971 virtual bool deleteAttribute( int attr );
1972
1980 bool deleteAttributes( const QList<int> &attrs );
1981
1982 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) FINAL;
1983
1994 Q_INVOKABLE bool deleteFeature( QgsFeatureId fid, QgsVectorLayer::DeleteContext *context = nullptr );
1995
2009 Q_INVOKABLE bool deleteFeatures( const QgsFeatureIds &fids, QgsVectorLayer::DeleteContext *context = nullptr );
2010
2034 Q_INVOKABLE bool commitChanges( bool stopEditing = true );
2035
2041 QStringList commitErrors() const;
2042
2052 Q_INVOKABLE bool rollBack( bool deleteBuffer = true );
2053
2060 QList<QgsRelation> referencingRelations( int idx ) const;
2061
2071 QList<QgsWeakRelation> weakRelations() const SIP_SKIP;
2072
2081 void setWeakRelations( const QList< QgsWeakRelation > &relations ) SIP_SKIP;
2082
2084 Q_INVOKABLE QgsVectorLayerEditBuffer *editBuffer() { return mEditBuffer; }
2085
2090 const QgsVectorLayerEditBuffer *editBuffer() const SIP_SKIP { return mEditBuffer; }
2091
2096 void beginEditCommand( const QString &text );
2097
2099 void endEditCommand();
2100
2102 void destroyEditCommand();
2103
2108 Q_DECL_DEPRECATED static void drawVertexMarker( double x, double y, QPainter &p, Qgis::VertexMarkerType type, int vertexSize );
2109
2118 void updateFields();
2119
2133 QVariant defaultValue( int index, const QgsFeature &feature = QgsFeature(),
2134 QgsExpressionContext *context = nullptr ) const;
2135
2146 void setDefaultValueDefinition( int index, const QgsDefaultValue &definition );
2147
2157 QgsDefaultValue defaultValueDefinition( int index ) const;
2158
2165 QgsFieldConstraints::Constraints fieldConstraints( int fieldIndex ) const;
2166
2171 QMap< QgsFieldConstraints::Constraint, QgsFieldConstraints::ConstraintStrength> fieldConstraintsAndStrength( int fieldIndex ) const;
2172
2181
2188 void removeFieldConstraint( int index, QgsFieldConstraints::Constraint constraint );
2189
2196 QString constraintExpression( int index ) const;
2197
2204 QString constraintDescription( int index ) const;
2205
2213 void setConstraintExpression( int index, const QString &expression, const QString &description = QString() );
2214
2220 void setFieldConfigurationFlags( int index, Qgis::FieldConfigurationFlags flags );
2221
2226 void setFieldConfigurationFlag( int index, Qgis::FieldConfigurationFlag flag, bool active );
2227
2233 Qgis::FieldConfigurationFlags fieldConfigurationFlags( int index ) const;
2234
2243 void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
2244
2253 QgsEditorWidgetSetup editorWidgetSetup( int index ) const;
2254
2266 QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const FINAL;
2267
2281 QStringList uniqueStringsMatching( int index, const QString &substring, int limit = -1,
2282 QgsFeedback *feedback = nullptr ) const;
2283
2298 QVariant minimumValue( int index ) const FINAL;
2299
2314 QVariant maximumValue( int index ) const FINAL;
2315
2316
2336 void minimumAndMaximumValue( int index, QVariant &minimum SIP_OUT, QVariant &maximum SIP_OUT ) const;
2337
2351 QVariant aggregate( Qgis::Aggregate aggregate,
2352 const QString &fieldOrExpression,
2353 const QgsAggregateCalculator::AggregateParameters &parameters = QgsAggregateCalculator::AggregateParameters(),
2354 QgsExpressionContext *context = nullptr,
2355 bool *ok = nullptr,
2356 QgsFeatureIds *fids = nullptr,
2357 QgsFeedback *feedback = nullptr,
2358 QString *error SIP_PYARGREMOVE = nullptr ) const;
2359
2361 void setFeatureBlendMode( QPainter::CompositionMode blendMode );
2363 QPainter::CompositionMode featureBlendMode() const;
2364
2365 QString htmlMetadata() const FINAL;
2366
2370 void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
2371
2375 inline const QgsVectorSimplifyMethod &simplifyMethod() const { return mSimplifyMethod; }
2376
2381 bool simplifyDrawingCanbeApplied( const QgsRenderContext &renderContext, Qgis::VectorRenderingSimplificationFlag simplifyHint ) const;
2382
2389 QgsConditionalLayerStyles *conditionalStyles() const;
2390
2395 QgsAttributeTableConfig attributeTableConfig() const;
2396
2401 void setAttributeTableConfig( const QgsAttributeTableConfig &attributeTableConfig );
2402
2404
2405 QgsExpressionContextScope *createExpressionContextScope() const FINAL SIP_FACTORY;
2406
2413 QgsEditFormConfig editFormConfig() const;
2414
2420 void setEditFormConfig( const QgsEditFormConfig &editFormConfig );
2421
2428 void setReadExtentFromXml( bool readExtentFromXml );
2429
2436 bool readExtentFromXml() const;
2437
2442 bool isEditCommandActive() const { return mEditCommandActive; }
2443
2449 QgsGeometryOptions *geometryOptions() const;
2450
2468 bool allowCommit() const SIP_SKIP;
2469
2487 void setAllowCommit( bool allowCommit ) SIP_SKIP;
2488
2494 QgsStoredExpressionManager *storedExpressionManager() { return mStoredExpressionManager; }
2495
2496 public slots:
2497
2505 void select( QgsFeatureId featureId );
2506
2514 Q_INVOKABLE void select( const QgsFeatureIds &featureIds );
2515
2523 void deselect( QgsFeatureId featureId );
2524
2532 Q_INVOKABLE void deselect( const QgsFeatureIds &featureIds );
2533
2540 Q_INVOKABLE void removeSelection();
2541
2552 void reselect();
2553
2560 virtual void updateExtents( bool force = false );
2561
2576 Q_INVOKABLE bool startEditing();
2577
2583 virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) override;
2584
2586
2587 bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
2588
2589 signals:
2590
2598 void selectionChanged( const QgsFeatureIds &selected, const QgsFeatureIds &deselected, bool clearAndSelect );
2599
2606
2609
2612
2618 void beforeCommitChanges( bool stopEditing );
2619
2622
2628
2634
2643 void attributeAdded( int idx );
2644
2651 void beforeAddingExpressionField( const QString &fieldName );
2652
2661 void attributeDeleted( int idx );
2662
2670
2677
2687
2697 void featuresDeleted( const QgsFeatureIds &fids );
2698
2704
2710
2719 void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value );
2720
2728 void geometryChanged( QgsFeatureId fid, const QgsGeometry &geometry );
2729
2731 void committedAttributesDeleted( const QString &layerId, const QgsAttributeList &deletedAttributes );
2733 void committedAttributesAdded( const QString &layerId, const QList<QgsField> &addedAttributes );
2735 void committedFeaturesAdded( const QString &layerId, const QgsFeatureList &addedFeatures );
2737 void committedFeaturesRemoved( const QString &layerId, const QgsFeatureIds &deletedFeatureIds );
2739 void committedAttributeValuesChanges( const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues );
2741 void committedGeometriesChanges( const QString &layerId, const QgsGeometryMap &changedGeometries );
2742
2744 void labelingFontNotFound( QgsVectorLayer *layer, const QString &fontfamily );
2745
2747 void featureBlendModeChanged( QPainter::CompositionMode blendMode );
2748
2754 void editCommandStarted( const QString &text );
2755
2762
2769
2779 void readCustomSymbology( const QDomElement &element, QString &errorMessage );
2780
2790 void writeCustomSymbology( QDomElement &element, QDomDocument &doc, QString &errorMessage ) const;
2791
2797
2801 void raiseError( const QString &msg );
2802
2808
2817
2824
2830
2831 protected:
2833 void setExtent( const QgsRectangle &rect ) FINAL;
2835 void setExtent3D( const QgsBox3D &rect ) FINAL;
2836
2837 private slots:
2838 void invalidateSymbolCountedFlag();
2839 void onFeatureCounterCompleted();
2840 void onFeatureCounterTerminated();
2841 void onJoinedFieldsChanged();
2842 void onFeatureAdded( QgsFeatureId fid );
2843 void onFeatureDeleted( QgsFeatureId fid );
2844 void onRelationsLoaded();
2845 void onSymbolsCounted();
2846 void onDirtyTransaction( const QString &sql, const QString &name );
2847 void emitDataChanged();
2848
2849 private:
2850 void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature(), QgsExpressionContext *context = nullptr );
2851
2861 bool isReadOnly() const FINAL;
2862
2869 bool setDataProvider( QString const &provider, const QgsDataProvider::ProviderOptions &options, Qgis::DataProviderReadFlags flags = Qgis::DataProviderReadFlags() );
2870
2882 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, Qgis::DataProviderReadFlags flags ) override;
2883
2885 void readSldLabeling( const QDomNode &node );
2886
2888 bool readSldTextSymbolizer( const QDomNode &node, QgsPalLayerSettings &settings ) const;
2889
2891 QgsAbstractVectorLayerLabeling *readLabelingFromCustomProperties();
2892
2893 bool deleteFeatureCascade( QgsFeatureId fid, DeleteContext *context = nullptr );
2894
2895#ifdef SIP_RUN
2896 QgsVectorLayer( const QgsVectorLayer &rhs );
2897#endif
2899 void minimumOrMaximumValue( int index, QVariant *minimum, QVariant *maximum ) const;
2900
2901 void createEditBuffer();
2902 void clearEditBuffer();
2903
2904 QgsConditionalLayerStyles *mConditionalStyles = nullptr;
2905 QgsVectorDataProvider *mDataProvider = nullptr;
2906 QgsVectorLayerSelectionProperties *mSelectionProperties = nullptr;
2907 QgsVectorLayerTemporalProperties *mTemporalProperties = nullptr;
2908 QgsVectorLayerElevationProperties *mElevationProperties = nullptr;
2909
2911 QString mDisplayExpression;
2912
2914 QgsActionManager *mActions = nullptr;
2915
2917 bool mDataSourceReadOnly = false;
2918
2925 bool mReadOnly = false;
2926
2932 QgsFeatureIds mSelectedFeatureIds;
2933
2937 QgsFeatureIds mPreviousSelectedFeatureIds;
2938
2940 QgsFields mFields;
2941
2943 QgsStringMap mAttributeAliasMap;
2944
2946 QMap<QString, QgsDefaultValue> mDefaultExpressionMap;
2947
2949 QMap< QString, Qgis::FieldDomainSplitPolicy > mAttributeSplitPolicy;
2950
2952 QMap< QString, Qgis::FieldDuplicatePolicy > mAttributeDuplicatePolicy;
2953
2955 QMap< QString, Qgis::FieldDomainMergePolicy > mAttributeMergePolicy;
2956
2958 QSet<int> mDefaultValueOnUpdateFields;
2959
2961 QMap< QString, QgsFieldConstraints::Constraints > mFieldConstraints;
2962
2964 QMap< QPair< QString, QgsFieldConstraints::Constraint >, QgsFieldConstraints::ConstraintStrength > mFieldConstraintStrength;
2965
2967 QMap< QString, QPair< QString, QString > > mFieldConstraintExpressions;
2968
2969 QMap< QString, Qgis::FieldConfigurationFlags > mFieldConfigurationFlags;
2970 QMap< QString, QgsEditorWidgetSetup > mFieldWidgetSetups;
2971
2973 QgsEditFormConfig mEditFormConfig;
2974
2977
2979 QgsFeatureRenderer *mRenderer = nullptr;
2980
2982 QgsVectorSimplifyMethod mSimplifyMethod;
2983
2985 QgsAbstractVectorLayerLabeling *mLabeling = nullptr;
2986
2988 bool mLabelsEnabled = false;
2989
2991 bool mLabelFontNotFoundNotified = false;
2992
2994 QPainter::CompositionMode mFeatureBlendMode = QPainter::CompositionMode_SourceOver;
2995
2997 bool mVertexMarkerOnlyForSelection = false;
2998
2999 QStringList mCommitErrors;
3000
3002 QgsVectorLayerEditBuffer *mEditBuffer = nullptr;
3006
3007 //stores information about joined layers
3008 QgsVectorLayerJoinBuffer *mJoinBuffer = nullptr;
3009
3011 QgsExpressionFieldBuffer *mExpressionFieldBuffer = nullptr;
3012
3013 //diagram rendering object. 0 if diagram drawing is disabled
3014 QgsDiagramRenderer *mDiagramRenderer = nullptr;
3015
3016 //stores infos about diagram placement (placement type, priority, position distance)
3017 QgsDiagramLayerSettings *mDiagramLayerSettings = nullptr;
3018
3019 mutable bool mValidExtent2D = false;
3020 mutable bool mLazyExtent2D = true;
3021 mutable bool mValidExtent3D = false;
3022 mutable bool mLazyExtent3D = true;
3023
3025 std::unique_ptr<QgsAuxiliaryLayer> mAuxiliaryLayer;
3026
3028 QString mAuxiliaryLayerKey;
3029
3030 // Features in renderer classes counted
3031 bool mSymbolFeatureCounted = false;
3032
3033 // Feature counts for each renderer legend key
3034 QHash<QString, long long> mSymbolFeatureCountMap;
3035 QHash<QString, QgsFeatureIds> mSymbolFeatureIdMap;
3036
3038 bool mEditCommandActive = false;
3039
3041 bool mCommitChangesActive = false;
3042
3043 bool mReadExtentFromXml;
3044 QgsRectangle mXmlExtent2D;
3045 QgsBox3D mXmlExtent3D;
3046
3047 QgsFeatureIds mDeletedFids;
3048
3049 QgsAttributeTableConfig mAttributeTableConfig;
3050
3051 mutable QMutex mFeatureSourceConstructorMutex;
3052
3053 QgsVectorLayerFeatureCounter *mFeatureCounter = nullptr;
3054
3055 std::unique_ptr<QgsGeometryOptions> mGeometryOptions;
3056
3057 bool mAllowCommit = true;
3058
3060 QgsStoredExpressionManager *mStoredExpressionManager = nullptr;
3061
3063
3065 bool mDataChangedFired = false;
3066
3067 QList<QgsWeakRelation> mWeakRelations;
3068
3069 bool mSetLegendFromStyle = false;
3070
3071 QList< QgsFeatureRendererGenerator * > mRendererGenerators;
3072
3074 QTimer *mRefreshRendererTimer = nullptr;
3075
3079 bool mLoadAllStoredStyle = false;
3080
3081};
3082
3083
3084
3085// clazy:excludeall=qstring-allocations
3086
3087#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:54
GeometryOperationResult
Success or failure of a geometry operation.
Definition qgis.h:2005
SpatialIndexPresence
Enumeration of spatial index presence states.
Definition qgis.h:522
VectorRenderingSimplificationFlag
Simplification flags for vector feature rendering.
Definition qgis.h:2923
FieldDomainMergePolicy
Merge policy for field domains.
Definition qgis.h:3789
FieldDomainSplitPolicy
Split policy for field domains.
Definition qgis.h:3772
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:337
FieldDuplicatePolicy
Duplicate policy for fields.
Definition qgis.h:3809
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition qgis.h:1796
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:256
@ Unknown
Unknown.
FieldConfigurationFlag
Configuration flags for fields These flags are meant to be user-configurable and are not describing a...
Definition qgis.h:1684
QFlags< FieldConfigurationFlag > FieldConfigurationFlags
Configuration flags for fields These flags are meant to be user-configurable and are not describing a...
Definition qgis.h:1699
SelectBehavior
Specifies how a selection should be applied.
Definition qgis.h:1734
@ 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.
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.
Definition qgsbox3d.h:43
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.
Definition qgscurve.h:35
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.
Contains configuration settings for an editor form.
Holder for the widget type and its configuration for a field.
Manages an editor widget.
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.
QFlags< Flag > Flags
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...
Definition qgsfeature.h:58
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
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.
Definition qgsfield.h:53
Container of fields for a vector layer.
Definition qgsfields.h:46
QgsAttributeList allAttributesList() const
Utility function to get list of attribute indexes.
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.
Definition qgsmaplayer.h:77
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
virtual bool isEditable() const
Returns true if the layer can be edited.
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.
Contains settings for how a map layer will be labeled.
Represents a 2D point.
Definition qgspointxy.h:60
Point geometry type, with support for z-dimension and m-values.
Definition qgspoint.h:49
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,...
Definition qgsproject.h:107
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.
Definition qgsrelation.h:44
Contains information about the context of a rendering operation.
A boolean settings entry.
A double 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.
Definition qgssymbol.h:231
Base class for vector data providers.
The edit buffer group manages a group of edit buffers.
Stores queued vector layer edit operations prior to committing changes to the layer's data provider.
An edit buffer which directly passes commands through, used when a layer is within a transaction.
Vector layer specific subclass of QgsMapLayerElevationProperties.
Counts the features in a QgsVectorLayer in task.
Partial snapshot of vector layer's state (only the members necessary for access to features).
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.
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.
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.
void attributeAdded(int idx)
Will be emitted, when a new attribute has been added to this vector layer.
QgsAbstractVectorLayerLabeling * labeling()
Access to labeling configuration.
void allowCommitChanged()
Emitted whenever the allowCommit() property of this layer changes.
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.
void editCommandDestroyed()
Signal emitted, when an edit command is destroyed.
QgsVectorLayer(const QgsVectorLayer &rhs)=delete
void featuresDeleted(const QgsFeatureIds &fids)
Emitted when features have been deleted.
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.
void symbolFeatureCountMapChanged()
Emitted when the feature count for symbols on this layer has been recalculated.
void writeCustomSymbology(QDomElement &element, QDomDocument &doc, QString &errorMessage) const
Signal emitted whenever the symbology (QML-file) for this layer is being written.
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.
void committedAttributesDeleted(const QString &layerId, const QgsAttributeList &deletedAttributes)
Emitted when attributes are deleted from the provider if not in transaction mode.
void displayExpressionChanged()
Emitted when the display expression changes.
const QgsActionManager * actions() const
Returns all layer actions defined on this layer.
void editFormConfigChanged()
Will be emitted whenever the edit form configuration of this layer changes.
void afterCommitChanges()
Emitted after changes are committed to the data provider.
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.
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.
const QgsVectorLayerEditBuffer * editBuffer() const
Buffer with uncommitted editing operations.
void beforeRollBack()
Emitted before changes are rolled back.
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.
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
Contains settings for simplifying geometries fetched from a vector layer.
Represent a QgsRelation with possibly unresolved layers or unmatched fields.
QMap< QString, QString > QgsStringMap
Definition qgis.h:6796
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_SKIP
Definition qgis_sip.h:126
#define FINAL
Definition qgis_sip.h:242
#define SIP_PYNAME(name)
Definition qgis_sip.h:81
#define SIP_PYARGREMOVE
Definition qgis_sip.h:151
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_FACTORY
Definition qgis_sip.h:76
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
Definition qgsfield.h:27
QList< int > QgsAttributeList
QSet< int > QgsAttributeIds
Context for cascade delete features.
DeleteContext(bool cascade=false, QgsProject *project=nullptr)
Constructor for DeleteContext.
Setting options for loading vector layers.
LayerOptions(bool loadDefaultStyle=true, bool readExtentFromXml=false)
Constructor for LayerOptions.
LayerOptions(const QgsCoordinateTransformContext &transformContext, bool loadDefaultStyle=true, bool readExtentFromXml=false)
Constructor for LayerOptions.
QgsCoordinateReferenceSystem fallbackCrs
Fallback layer coordinate reference system.