QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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"
45
46class QPainter;
47class QImage;
48
52class QgsCurve;
58class QgsGeometry;
59class QgsGeometryVertexIndex;
60class QgsMapToPixel;
61class QgsRectangle;
62class QgsRectangle;
63class QgsRelation;
64class QgsWeakRelation;
68class QgsSymbol;
75class QgsPoint;
76class QgsFeedback;
84
85#ifndef SIP_RUN
86template<class T>
88#endif
91
92
93typedef QList<int> QgsAttributeList;
94typedef QSet<int> QgsAttributeIds;
95
96// TODO QGIS4: Remove virtual from non-inherited methods (like isModified)
97
399{
400 Q_OBJECT
401
402 Q_PROPERTY( QString subsetString READ subsetString WRITE setSubsetString NOTIFY subsetStringChanged )
403 Q_PROPERTY( QString displayExpression READ displayExpression WRITE setDisplayExpression NOTIFY displayExpressionChanged )
404 Q_PROPERTY( QgsEditFormConfig editFormConfig READ editFormConfig WRITE setEditFormConfig NOTIFY editFormConfigChanged )
405 Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged )
406 Q_PROPERTY( bool supportsEditing READ supportsEditing NOTIFY supportsEditingChanged )
407
408 public:
409
410 static const QgsSettingsEntryBool *settingsSimplifyLocal SIP_SKIP;
411
412 static const QgsSettingsEntryDouble *settingsSimplifyMaxScale SIP_SKIP;
413 static const QgsSettingsEntryDouble *settingsSimplifyDrawingTol SIP_SKIP;
416
422 {
423
427 explicit LayerOptions( bool loadDefaultStyle = true,
428 bool readExtentFromXml = false )
429 : loadDefaultStyle( loadDefaultStyle )
430 , readExtentFromXml( readExtentFromXml )
431 {}
432
437 explicit LayerOptions( const QgsCoordinateTransformContext &transformContext,
438 bool loadDefaultStyle = true,
439 bool readExtentFromXml = false
440 )
441 : loadDefaultStyle( loadDefaultStyle )
442 , readExtentFromXml( readExtentFromXml )
443 , transformContext( transformContext )
444 {}
445
447 bool loadDefaultStyle = true;
448
453 bool readExtentFromXml = false;
454
460
473
486
500 bool skipCrsValidation = false;
501
513 bool forceReadOnly = false;
514
527 bool loadAllStoredStyles = false;
528 };
529
534 struct CORE_EXPORT DeleteContext
535 {
536
540 explicit DeleteContext( bool cascade = false, QgsProject *project = nullptr ): cascade( cascade ), project( project ) {}
541
548 QList<QgsVectorLayer *> handledLayers( bool includeAuxiliaryLayers = true ) const;
549
553 QgsFeatureIds handledFeatures( QgsVectorLayer *layer ) const;
554
555 QMap<QgsVectorLayer *, QgsFeatureIds> mHandledFeatures SIP_SKIP;
558 };
559
573 explicit QgsVectorLayer( const QString &path = QString(), const QString &baseName = QString(),
574 const QString &providerLib = "ogr", const QgsVectorLayer::LayerOptions &options = QgsVectorLayer::LayerOptions() );
575
576 ~QgsVectorLayer() override;
577
579 QgsVectorLayer( const QgsVectorLayer &rhs ) = delete;
581 QgsVectorLayer &operator=( QgsVectorLayer const &rhs ) = delete;
582
583#ifdef SIP_RUN
584 SIP_PYOBJECT __repr__();
585 % MethodCode
586 QString str = QStringLiteral( "<QgsVectorLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
587 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
588 % End
589#endif
590
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 QgsMapLayerTemporalProperties *temporalProperties() override;
669 QgsMapLayerElevationProperties *elevationProperties() override;
670 QgsAbstractProfileGenerator *createProfileGenerator( const QgsProfileRequest &request ) override SIP_FACTORY;
671
682 void setProviderEncoding( const QString &encoding );
683
685 void setCoordinateSystem();
686
692 bool addJoin( const QgsVectorLayerJoinInfo &joinInfo );
693
698 bool removeJoin( const QString &joinLayerId );
699
704 QgsVectorLayerJoinBuffer *joinBuffer() { return mJoinBuffer; }
705
710 const QgsVectorLayerJoinBuffer *joinBuffer() const { return mJoinBuffer; } SIP_SKIP;
711
712 const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
713
722 bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) FINAL;
723
731 QSet<QgsMapLayerDependency> dependencies() const FINAL;
732
743 int addExpressionField( const QString &exp, const QgsField &fld );
744
752 void removeExpressionField( int index );
753
763 QString expressionField( int index ) const;
764
774 void updateExpressionField( int index, const QString &exp );
775
782 QgsActionManager *actions() { return mActions; }
783
789 const QgsActionManager *actions() const SIP_SKIP { return mActions; }
790
796 int selectedFeatureCount() const;
797
807 Q_INVOKABLE void selectByRect( QgsRectangle &rect, Qgis::SelectBehavior behavior = Qgis::SelectBehavior::SetSelection );
808
819 Q_INVOKABLE void selectByExpression( const QString &expression, Qgis::SelectBehavior behavior = Qgis::SelectBehavior::SetSelection, QgsExpressionContext *context = nullptr );
820
831 Q_INVOKABLE void selectByIds( const QgsFeatureIds &ids, Qgis::SelectBehavior behavior = Qgis::SelectBehavior::SetSelection );
832
844 Q_INVOKABLE void modifySelection( const QgsFeatureIds &selectIds, const QgsFeatureIds &deselectIds );
845
847 Q_INVOKABLE void invertSelection();
848
850 Q_INVOKABLE void selectAll();
851
859 Q_INVOKABLE void invertSelectionInRectangle( QgsRectangle &rect );
860
873 Q_INVOKABLE QgsFeatureList selectedFeatures() const;
874
890 QgsFeatureIterator getSelectedFeatures( QgsFeatureRequest request = QgsFeatureRequest() ) const;
891
899 Q_INVOKABLE const QgsFeatureIds &selectedFeatureIds() const;
900
902 Q_INVOKABLE QgsRectangle boundingBoxOfSelected() const;
903
911 bool labelsEnabled() const;
912
922 void setLabelsEnabled( bool enabled );
923
929 bool diagramsEnabled() const;
930
932 void setDiagramRenderer( QgsDiagramRenderer *r SIP_TRANSFER );
933 const QgsDiagramRenderer *diagramRenderer() const { return mDiagramRenderer; }
934
935 void setDiagramLayerSettings( const QgsDiagramLayerSettings &s );
936 const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
937
944 QgsFeatureRenderer *renderer() { return mRenderer; }
945
953 const QgsFeatureRenderer *renderer() const SIP_SKIP { return mRenderer; }
954
961 void setRenderer( QgsFeatureRenderer *r SIP_TRANSFER );
962
972 void addFeatureRendererGenerator( QgsFeatureRendererGenerator *generator SIP_TRANSFER );
973
983 void removeFeatureRendererGenerator( const QString &id );
984
992 QList< const QgsFeatureRendererGenerator * > featureRendererGenerators() const;
993
995 Q_INVOKABLE Qgis::GeometryType geometryType() const;
996
998 Q_INVOKABLE Qgis::WkbType wkbType() const FINAL;
999
1000 QgsCoordinateReferenceSystem sourceCrs() const FINAL;
1001 QString sourceName() const FINAL;
1002
1007 bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) FINAL;
1008
1013 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const FINAL;
1014
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;
1017
1022 void resolveReferences( QgsProject *project ) FINAL;
1023
1040 virtual void saveStyleToDatabase( const QString &name, const QString &description,
1041 bool useAsDefault, const QString &uiFileContent,
1042 QString &msgError SIP_OUT,
1043 QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
1044
1054 virtual int listStylesInDatabase( QStringList &ids SIP_OUT, QStringList &names SIP_OUT,
1055 QStringList &descriptions SIP_OUT, QString &msgError SIP_OUT );
1056
1060 virtual QString getStyleFromDatabase( const QString &styleId, QString &msgError SIP_OUT );
1061
1069 virtual bool deleteStyleFromDatabase( const QString &styleId, QString &msgError SIP_OUT );
1070
1078 virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag SIP_OUT, bool loadFromLocalDb,
1079 QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
1080
1085 QString loadNamedStyle( const QString &theURI, bool &resultFlag SIP_OUT,
1086 QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1087
1101 bool loadAuxiliaryLayer( const QgsAuxiliaryStorage &storage, const QString &key = QString() );
1102
1112 void setAuxiliaryLayer( QgsAuxiliaryLayer *layer SIP_TRANSFER = nullptr );
1113
1119 QgsAuxiliaryLayer *auxiliaryLayer();
1120
1126 const QgsAuxiliaryLayer *auxiliaryLayer() const SIP_SKIP;
1127
1128 bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
1129 QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1130 bool readStyle( const QDomNode &node, QString &errorMessage,
1131 QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1132 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1133 const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
1134 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1135 const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
1136
1145 bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const;
1146
1147 bool readSld( const QDomNode &node, QString &errorMessage ) FINAL;
1148
1154 long long featureCount( const QString &legendKey ) const;
1155
1162 QgsFeatureIds symbolFeatureIds( const QString &legendKey ) const;
1163
1174 FeatureAvailability hasFeatures() const FINAL;
1175
1176
1177 QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
1178
1192 QgsVectorLayerFeatureCounter *countSymbolFeatures( bool storeSymbolFids = false );
1193
1201 virtual bool setSubsetString( const QString &subset );
1202
1207 virtual QString subsetString() const;
1208
1214 QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const FINAL;
1215
1219 inline QgsFeatureIterator getFeatures( const QString &expression )
1220 {
1221 return getFeatures( QgsFeatureRequest( expression ) );
1222 }
1223
1229 {
1230 QgsFeature feature;
1231 getFeatures( QgsFeatureRequest( fid ) ).nextFeature( feature );
1232 return feature;
1233 }
1234
1239 QgsGeometry getGeometry( QgsFeatureId fid ) const;
1240
1245 {
1246 return getFeatures( QgsFeatureRequest( fids ) );
1247 }
1248
1253 {
1254 return getFeatures( QgsFeatureRequest( rectangle ) );
1255 }
1256
1257 bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) FINAL;
1258
1284 bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
1285
1297 bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
1298
1310 bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
1311
1322 bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
1323
1334 bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) SIP_PYNAME( moveVertexV2 );
1335
1346 Qgis::VectorEditResult deleteVertex( QgsFeatureId featureId, int vertex );
1347
1355 Q_INVOKABLE bool deleteSelectedFeatures( int *deletedCount = nullptr, QgsVectorLayer::DeleteContext *context = nullptr );
1356
1377 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addRing( const QVector<QgsPointXY> &ring, QgsFeatureId *featureId = nullptr ) SIP_DEPRECATED;
1378
1379
1399 Q_INVOKABLE Qgis::GeometryOperationResult addRing( const QgsPointSequence &ring, QgsFeatureId *featureId = nullptr );
1400
1421 Q_INVOKABLE Qgis::GeometryOperationResult addRing( QgsCurve *ring SIP_TRANSFER, QgsFeatureId *featureId = nullptr ) SIP_PYNAME( addCurvedRing );
1422
1442 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addPart( const QList<QgsPointXY> &ring ) SIP_DEPRECATED;
1443
1444#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1445
1466 Q_DECL_DEPRECATED Qgis::GeometryOperationResult addPart( const QVector<QgsPointXY> &ring ) SIP_PYNAME( addPartV2 ) SIP_DEPRECATED;
1467#endif
1468
1488 Q_INVOKABLE Qgis::GeometryOperationResult addPart( const QgsPointSequence &ring ) SIP_PYNAME( addPartV2 );
1489
1497 Q_INVOKABLE Qgis::GeometryOperationResult addPart( QgsCurve *ring SIP_TRANSFER ) SIP_PYNAME( addCurvedPart );
1498
1510 Q_INVOKABLE int translateFeature( QgsFeatureId featureId, double dx, double dy );
1511
1532 Q_DECL_DEPRECATED Qgis::GeometryOperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
1533
1553 Q_INVOKABLE Qgis::GeometryOperationResult splitParts( const QgsPointSequence &splitLine, bool topologicalEditing = false );
1554
1575 Q_DECL_DEPRECATED Qgis::GeometryOperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
1576
1596 Q_INVOKABLE Qgis::GeometryOperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false );
1597
1620 Q_INVOKABLE Qgis::GeometryOperationResult splitFeatures( const QgsCurve *curve, QgsPointSequence &topologyTestPoints SIP_OUT, bool preserveCircular = false, bool topologicalEditing = false );
1621
1635 int addTopologicalPoints( const QgsGeometry &geom );
1636
1653 Q_DECL_DEPRECATED int addTopologicalPoints( const QgsPointXY &p ) SIP_DEPRECATED;
1654
1671 int addTopologicalPoints( const QgsPoint &p );
1672
1689 int addTopologicalPoints( const QgsPointSequence &ps );
1690
1697 const QgsAbstractVectorLayerLabeling *labeling() const SIP_SKIP { return mLabeling; }
1698
1706
1711 void setLabeling( QgsAbstractVectorLayerLabeling *labeling SIP_TRANSFER );
1712
1714 bool isEditable() const FINAL;
1715
1717 bool isSpatial() const FINAL;
1718
1720 bool isModified() const override;
1721
1728 bool isAuxiliaryField( int index, int &srcIndex ) const;
1729
1731 void reload() FINAL;
1732
1737 QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) FINAL SIP_FACTORY;
1738
1739 QgsRectangle extent() const FINAL;
1740 QgsRectangle sourceExtent() const FINAL;
1741
1748 QgsFields fields() const FINAL;
1749
1753 inline QgsAttributeList attributeList() const { return mFields.allAttributesList(); }
1754
1758 QgsAttributeList primaryKeyAttributes() const;
1759
1765 long long featureCount() const FINAL;
1766
1773 bool setReadOnly( bool readonly = true );
1774
1780 bool supportsEditing() const override;
1781
1802 bool changeGeometry( QgsFeatureId fid, QgsGeometry &geometry, bool skipDefaultValue = false );
1803
1834 bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant(), bool skipDefaultValues = false );
1835
1871 bool changeAttributeValues( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap(), bool skipDefaultValues = false );
1872
1882 bool addAttribute( const QgsField &field );
1883
1889 void setFieldAlias( int index, const QString &aliasString );
1890
1896 void removeFieldAlias( int index );
1897
1908 bool renameAttribute( int index, const QString &newName );
1909
1916 QString attributeAlias( int index ) const;
1917
1919 QString attributeDisplayName( int index ) const;
1920
1922 QgsStringMap attributeAliases() const;
1923
1924#ifndef SIP_RUN
1925
1931 void setFieldSplitPolicy( int index, Qgis::FieldDomainSplitPolicy policy );
1932#else
1933
1940 void setFieldSplitPolicy( int index, Qgis::FieldDomainSplitPolicy policy );
1941
1942 % MethodCode
1943 if ( a0 < 0 || a0 >= sipCpp->fields().count() )
1944 {
1945 PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
1946 sipIsErr = 1;
1947 }
1948 else
1949 {
1950 sipCpp->setFieldSplitPolicy( a0, a1 );
1951 }
1952 % End
1953#endif
1954
1959 Q_DECL_DEPRECATED QSet<QString> excludeAttributesWms() const SIP_DEPRECATED;
1960
1965 Q_DECL_DEPRECATED void setExcludeAttributesWms( const QSet<QString> &att ) SIP_DEPRECATED;
1966
1971 Q_DECL_DEPRECATED QSet<QString> excludeAttributesWfs() const SIP_DEPRECATED;
1972
1977 Q_DECL_DEPRECATED void setExcludeAttributesWfs( const QSet<QString> &att ) SIP_DEPRECATED;
1978
1987 virtual bool deleteAttribute( int attr );
1988
1996 bool deleteAttributes( const QList<int> &attrs );
1997
1998 bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) FINAL;
1999
2010 bool deleteFeature( QgsFeatureId fid, DeleteContext *context = nullptr );
2011
2025 bool deleteFeatures( const QgsFeatureIds &fids, DeleteContext *context = nullptr );
2026
2050 Q_INVOKABLE bool commitChanges( bool stopEditing = true );
2051
2057 QStringList commitErrors() const;
2058
2068 Q_INVOKABLE bool rollBack( bool deleteBuffer = true );
2069
2076 QList<QgsRelation> referencingRelations( int idx ) const;
2077
2087 QList<QgsWeakRelation> weakRelations() const SIP_SKIP;
2088
2097 void setWeakRelations( const QList< QgsWeakRelation > &relations ) SIP_SKIP;
2098
2100 Q_INVOKABLE QgsVectorLayerEditBuffer *editBuffer() { return mEditBuffer; }
2101
2106 const QgsVectorLayerEditBuffer *editBuffer() const SIP_SKIP { return mEditBuffer; }
2107
2112 void beginEditCommand( const QString &text );
2113
2115 void endEditCommand();
2116
2118 void destroyEditCommand();
2119
2124 Q_DECL_DEPRECATED static void drawVertexMarker( double x, double y, QPainter &p, Qgis::VertexMarkerType type, int vertexSize );
2125
2134 void updateFields();
2135
2150 QVariant defaultValue( int index, const QgsFeature &feature = QgsFeature(),
2151 QgsExpressionContext *context = nullptr ) const;
2152
2164 void setDefaultValueDefinition( int index, const QgsDefaultValue &definition );
2165
2176 QgsDefaultValue defaultValueDefinition( int index ) const;
2177
2185 QgsFieldConstraints::Constraints fieldConstraints( int fieldIndex ) const;
2186
2192 QMap< QgsFieldConstraints::Constraint, QgsFieldConstraints::ConstraintStrength> fieldConstraintsAndStrength( int fieldIndex ) const;
2193
2203
2211 void removeFieldConstraint( int index, QgsFieldConstraints::Constraint constraint );
2212
2220 QString constraintExpression( int index ) const;
2221
2229 QString constraintDescription( int index ) const;
2230
2239 void setConstraintExpression( int index, const QString &expression, const QString &description = QString() );
2240
2246 void setFieldConfigurationFlags( int index, QgsField::ConfigurationFlags flags ) SIP_SKIP;
2247
2252 void setFieldConfigurationFlag( int index, QgsField::ConfigurationFlag flag, bool active ) SIP_SKIP;
2253
2259 QgsField::ConfigurationFlags fieldConfigurationFlags( int index ) const SIP_SKIP;
2260
2264 void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
2265
2272 QgsEditorWidgetSetup editorWidgetSetup( int index ) const;
2273
2285 QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const FINAL;
2286
2300 QStringList uniqueStringsMatching( int index, const QString &substring, int limit = -1,
2301 QgsFeedback *feedback = nullptr ) const;
2302
2317 QVariant minimumValue( int index ) const FINAL;
2318
2333 QVariant maximumValue( int index ) const FINAL;
2334
2335
2355 void minimumAndMaximumValue( int index, QVariant &minimum SIP_OUT, QVariant &maximum SIP_OUT ) const;
2356
2371 QVariant aggregate( QgsAggregateCalculator::Aggregate aggregate,
2372 const QString &fieldOrExpression,
2373 const QgsAggregateCalculator::AggregateParameters &parameters = QgsAggregateCalculator::AggregateParameters(),
2374 QgsExpressionContext *context = nullptr,
2375 bool *ok = nullptr,
2376 QgsFeatureIds *fids = nullptr,
2377 QgsFeedback *feedback = nullptr,
2378 QString *error SIP_PYARGREMOVE = nullptr ) const;
2379
2381 void setFeatureBlendMode( QPainter::CompositionMode blendMode );
2383 QPainter::CompositionMode featureBlendMode() const;
2384
2385 QString htmlMetadata() const FINAL;
2386
2391 void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
2392
2397 inline const QgsVectorSimplifyMethod &simplifyMethod() const { return mSimplifyMethod; }
2398
2404 bool simplifyDrawingCanbeApplied( const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
2405
2413 QgsConditionalLayerStyles *conditionalStyles() const;
2414
2419 QgsAttributeTableConfig attributeTableConfig() const;
2420
2425 void setAttributeTableConfig( const QgsAttributeTableConfig &attributeTableConfig );
2426
2428
2429 QgsExpressionContextScope *createExpressionContextScope() const FINAL SIP_FACTORY;
2430
2438 QgsEditFormConfig editFormConfig() const;
2439
2446 void setEditFormConfig( const QgsEditFormConfig &editFormConfig );
2447
2455 void setReadExtentFromXml( bool readExtentFromXml );
2456
2464 bool readExtentFromXml() const;
2465
2471 bool isEditCommandActive() const { return mEditCommandActive; }
2472
2478 QgsGeometryOptions *geometryOptions() const;
2479
2497 bool allowCommit() const SIP_SKIP;
2498
2516 void setAllowCommit( bool allowCommit ) SIP_SKIP;
2517
2523 QgsStoredExpressionManager *storedExpressionManager() { return mStoredExpressionManager; }
2524
2525 public slots:
2526
2534 void select( QgsFeatureId featureId );
2535
2543 Q_INVOKABLE void select( const QgsFeatureIds &featureIds );
2544
2552 void deselect( QgsFeatureId featureId );
2553
2561 Q_INVOKABLE void deselect( const QgsFeatureIds &featureIds );
2562
2569 Q_INVOKABLE void removeSelection();
2570
2581 void reselect();
2582
2589 virtual void updateExtents( bool force = false );
2590
2605 Q_INVOKABLE bool startEditing();
2606
2612 virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) override;
2613
2615
2616 bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
2617
2618 signals:
2619
2627 void selectionChanged( const QgsFeatureIds &selected, const QgsFeatureIds &deselected, bool clearAndSelect );
2628
2635
2638
2641
2647 void beforeCommitChanges( bool stopEditing );
2648
2651
2657
2663
2672 void attributeAdded( int idx );
2673
2680 void beforeAddingExpressionField( const QString &fieldName );
2681
2690 void attributeDeleted( int idx );
2691
2699
2706
2716
2726 void featuresDeleted( const QgsFeatureIds &fids );
2727
2733
2739
2748 void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value );
2749
2757 void geometryChanged( QgsFeatureId fid, const QgsGeometry &geometry );
2758
2760 void committedAttributesDeleted( const QString &layerId, const QgsAttributeList &deletedAttributes );
2762 void committedAttributesAdded( const QString &layerId, const QList<QgsField> &addedAttributes );
2764 void committedFeaturesAdded( const QString &layerId, const QgsFeatureList &addedFeatures );
2766 void committedFeaturesRemoved( const QString &layerId, const QgsFeatureIds &deletedFeatureIds );
2768 void committedAttributeValuesChanges( const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues );
2770 void committedGeometriesChanges( const QString &layerId, const QgsGeometryMap &changedGeometries );
2771
2773 void labelingFontNotFound( QgsVectorLayer *layer, const QString &fontfamily );
2774
2776 void featureBlendModeChanged( QPainter::CompositionMode blendMode );
2777
2783 void editCommandStarted( const QString &text );
2784
2791
2798
2808 void readCustomSymbology( const QDomElement &element, QString &errorMessage );
2809
2819 void writeCustomSymbology( QDomElement &element, QDomDocument &doc, QString &errorMessage ) const;
2820
2827
2831 void raiseError( const QString &msg );
2832
2839
2849
2856
2863
2864 protected:
2866 void setExtent( const QgsRectangle &rect ) FINAL;
2867
2868 private slots:
2869 void invalidateSymbolCountedFlag();
2870 void onFeatureCounterCompleted();
2871 void onFeatureCounterTerminated();
2872 void onJoinedFieldsChanged();
2873 void onFeatureDeleted( QgsFeatureId fid );
2874 void onRelationsLoaded();
2875 void onSymbolsCounted();
2876 void onDirtyTransaction( const QString &sql, const QString &name );
2877 void emitDataChanged();
2878 void onAfterCommitChangesDependency();
2879
2880 private:
2881 void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature() );
2882
2892 bool isReadOnly() const FINAL;
2893
2900 bool setDataProvider( QString const &provider, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
2901
2913 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags ) override;
2914
2916 void readSldLabeling( const QDomNode &node );
2917
2919 bool readSldTextSymbolizer( const QDomNode &node, QgsPalLayerSettings &settings ) const;
2920
2922 QgsAbstractVectorLayerLabeling *readLabelingFromCustomProperties();
2923
2924 bool deleteFeatureCascade( QgsFeatureId fid, DeleteContext *context = nullptr );
2925
2926#ifdef SIP_RUN
2927 QgsVectorLayer( const QgsVectorLayer &rhs );
2928#endif
2930 void minimumOrMaximumValue( int index, QVariant *minimum, QVariant *maximum ) const;
2931
2932 void createEditBuffer();
2933 void clearEditBuffer();
2934
2935 QgsConditionalLayerStyles *mConditionalStyles = nullptr;
2936
2938 QgsVectorDataProvider *mDataProvider = nullptr;
2939
2941 QgsVectorLayerTemporalProperties *mTemporalProperties = nullptr;
2942
2943 QgsVectorLayerElevationProperties *mElevationProperties = nullptr;
2944
2946 QString mDisplayExpression;
2947
2949 QgsActionManager *mActions = nullptr;
2950
2952 bool mDataSourceReadOnly = false;
2953
2960 bool mReadOnly = false;
2961
2967 QgsFeatureIds mSelectedFeatureIds;
2968
2972 QgsFeatureIds mPreviousSelectedFeatureIds;
2973
2975 QgsFields mFields;
2976
2978 QgsStringMap mAttributeAliasMap;
2979
2981 QMap<QString, QgsDefaultValue> mDefaultExpressionMap;
2982
2984 QMap< QString, Qgis::FieldDomainSplitPolicy > mAttributeSplitPolicy;
2985
2987 QSet<int> mDefaultValueOnUpdateFields;
2988
2990 QMap< QString, QgsFieldConstraints::Constraints > mFieldConstraints;
2991
2993 QMap< QPair< QString, QgsFieldConstraints::Constraint >, QgsFieldConstraints::ConstraintStrength > mFieldConstraintStrength;
2994
2996 QMap< QString, QPair< QString, QString > > mFieldConstraintExpressions;
2997
2998 QMap< QString, QgsField::ConfigurationFlags > mFieldConfigurationFlags;
2999 QMap< QString, QgsEditorWidgetSetup > mFieldWidgetSetups;
3000
3002 QgsEditFormConfig mEditFormConfig;
3003
3006
3008 QgsFeatureRenderer *mRenderer = nullptr;
3009
3011 QgsVectorSimplifyMethod mSimplifyMethod;
3012
3014 QgsAbstractVectorLayerLabeling *mLabeling = nullptr;
3015
3017 bool mLabelsEnabled = false;
3018
3020 bool mLabelFontNotFoundNotified = false;
3021
3023 QPainter::CompositionMode mFeatureBlendMode = QPainter::CompositionMode_SourceOver;
3024
3026 bool mVertexMarkerOnlyForSelection = false;
3027
3028 QStringList mCommitErrors;
3029
3031 QgsVectorLayerEditBuffer *mEditBuffer = nullptr;
3035
3036 //stores information about joined layers
3037 QgsVectorLayerJoinBuffer *mJoinBuffer = nullptr;
3038
3040 QgsExpressionFieldBuffer *mExpressionFieldBuffer = nullptr;
3041
3042 //diagram rendering object. 0 if diagram drawing is disabled
3043 QgsDiagramRenderer *mDiagramRenderer = nullptr;
3044
3045 //stores infos about diagram placement (placement type, priority, position distance)
3046 QgsDiagramLayerSettings *mDiagramLayerSettings = nullptr;
3047
3048 mutable bool mValidExtent = false;
3049 mutable bool mLazyExtent = true;
3050
3052 std::unique_ptr<QgsAuxiliaryLayer> mAuxiliaryLayer;
3053
3055 QString mAuxiliaryLayerKey;
3056
3057 // Features in renderer classes counted
3058 bool mSymbolFeatureCounted = false;
3059
3060 // Feature counts for each renderer legend key
3061 QHash<QString, long long> mSymbolFeatureCountMap;
3062 QHash<QString, QgsFeatureIds> mSymbolFeatureIdMap;
3063
3065 bool mEditCommandActive = false;
3066
3068 bool mCommitChangesActive = false;
3069
3070 bool mReadExtentFromXml;
3071 QgsRectangle mXmlExtent;
3072
3073 QgsFeatureIds mDeletedFids;
3074
3075 QgsAttributeTableConfig mAttributeTableConfig;
3076
3077 mutable QMutex mFeatureSourceConstructorMutex;
3078
3079 QgsVectorLayerFeatureCounter *mFeatureCounter = nullptr;
3080
3081 std::unique_ptr<QgsGeometryOptions> mGeometryOptions;
3082
3083 bool mAllowCommit = true;
3084
3086 QgsStoredExpressionManager *mStoredExpressionManager = nullptr;
3087
3089
3091 bool mDataChangedFired = false;
3092
3093 QList<QgsWeakRelation> mWeakRelations;
3094
3095 bool mSetLegendFromStyle = false;
3096
3097 QList< QgsFeatureRendererGenerator * > mRendererGenerators;
3098
3100 QTimer *mRefreshRendererTimer = nullptr;
3101
3105 bool mLoadAllStoredStyle = false;
3106
3107};
3108
3109
3110
3111// clazy:excludeall=qstring-allocations
3112
3113#endif
The Qgis class provides global constants for use throughout the application.
Definition: qgis.h:55
GeometryOperationResult
Success or failure of a geometry operation.
Definition: qgis.h:1266
FieldDomainSplitPolicy
Split policy for field domains.
Definition: qgis.h:2273
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition: qgis.h:228
VertexMarkerType
Editing vertex markers, used for showing vertices during a edit operation.
Definition: qgis.h:1071
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition: qgis.h:155
@ Unknown
Unknown.
SelectBehavior
Specifies how a selection should be applied.
Definition: qgis.h:1009
@ SetSelection
Set selection, removing any existing selection.
Abstract base class for simplify 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 ...
This is a container for configuration of the attribute table.
Class allowing to manage the auxiliary storage for a vector layer.
Class providing some utility methods to manage auxiliary storage.
The QgsConditionalLayerStyles class holds conditional style information for a layer.
This class 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:36
Abstract base class for spatial data provider implementations.
The QgsDefaultValue class 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 Widget and wrapper share the same parent.
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)
An interface for objects which generate feature renderers for vector layers.
This class 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.
SpatialIndexPresence
Enumeration of spatial index presence states.
virtual Qgis::WkbType wkbType() const =0
Returns the geometry type for features returned by this 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.
virtual SpatialIndexPresence hasSpatialIndex() const
Returns an enum value representing the presence of a valid spatial index on the source,...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:56
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition: qgsfeedback.h:45
ConstraintStrength
Strength of constraints.
@ ConstraintStrengthHard
Constraint must be honored before feature can be accepted.
Constraint
Constraints which may be present on a field.
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:52
ConfigurationFlag
Configuration flags for fields These flags are meant to be user-configurable and are not describing a...
Definition: qgsfield.h:81
Container of fields for a vector layer.
Definition: qgsfields.h:45
The QgsGeometryOptions class contains options to automatically adjust geometries to constraints on a ...
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:164
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 temporal properties.
Base class for all map layer types.
Definition: qgsmaplayer.h:73
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 QSet< QgsMapLayerDependency > dependencies() const
Gets the list of dependencies.
friend class QgsVectorLayer
Definition: qgsmaplayer.h:2189
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.
Definition: qgsmaptopixel.h:39
Contains settings for how a map layer will be labeled.
A class to represent a 2D point.
Definition: qgspointxy.h:59
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:105
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
This class manages a set of relations between layers.
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.
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:93
This is the base class for vector data providers.
The edit buffer group manages a group of edit buffers.
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 map layer temporal properties for vector layers.
Represents a vector layer which manages a vector based data sets.
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 allowCommitChanged() 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
QgsVectorLayer cannot be copied.
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
QgsVectorLayer cannot be copied.
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.
QgsFeature getFeature(QgsFeatureId fid) const
Queries the layer for the feature with the given id.
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.
const QgsDiagramRenderer * diagramRenderer() const
This class contains information how to simplify geometries fetched from a vector layer.
SimplifyHint
Simplification flags for fast rendering of features.
The QgsWeakRelation class represent a QgsRelation with possibly unresolved layers or unmatched fields...
#define str(x)
Definition: qgis.cpp:37
QMap< QString, QString > QgsStringMap
Definition: qgis.h:4054
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_SKIP
Definition: qgis_sip.h:126
#define FINAL
Definition: qgis_sip.h:237
#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
Definition: qgsattributes.h:42
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:915
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:906
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:920
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeatureid.h:37
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
Definition: qgsfeatureid.h:28
QList< int > QgsAttributeList
Definition: qgsfield.h:26
const QgsField & field
Definition: qgsfield.h:501
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.