QGIS API Documentation  3.19.0-Master (393d60bf25)
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 
22 #include "qgis_core.h"
23 #include <QMap>
24 #include <QSet>
25 #include <QList>
26 #include <QStringList>
27 #include <QFont>
28 #include <QMutex>
29 
30 #include "qgis.h"
31 #include "qgsmaplayer.h"
32 #include "qgsfeature.h"
33 #include "qgsfeaturerequest.h"
34 #include "qgsfeaturesource.h"
35 #include "qgsfields.h"
36 #include "qgsvectordataprovider.h"
39 #include "qgseditformconfig.h"
41 #include "qgsaggregatecalculator.h"
42 #include "qgsfeatureiterator.h"
45 #include "qgsexpressioncontext.h"
46 
47 class QPainter;
48 class QImage;
49 
51 class QgsActionManager;
53 class QgsCurve;
55 class QgsDiagramRenderer;
58 class QgsFeatureRenderer;
59 class QgsGeometry;
60 class QgsGeometryVertexIndex;
61 class QgsMapToPixel;
62 class QgsRectangle;
63 class QgsRectangle;
64 class QgsRelation;
65 class QgsWeakRelation;
66 class QgsRelationManager;
69 class QgsSymbol;
76 class QgsPoint;
77 class QgsFeedback;
79 class QgsAuxiliaryLayer;
80 class QgsGeometryOptions;
84 
85 typedef QList<int> QgsAttributeList;
86 typedef QSet<int> QgsAttributeIds;
87 
88 // TODO QGIS4: Remove virtual from non-inherited methods (like isModified)
89 
393 {
394  Q_OBJECT
395 
396  Q_PROPERTY( QString subsetString READ subsetString WRITE setSubsetString NOTIFY subsetStringChanged )
397  Q_PROPERTY( QString displayExpression READ displayExpression WRITE setDisplayExpression NOTIFY displayExpressionChanged )
398  Q_PROPERTY( QString mapTipTemplate READ mapTipTemplate WRITE setMapTipTemplate NOTIFY mapTipTemplateChanged )
399  Q_PROPERTY( QgsEditFormConfig editFormConfig READ editFormConfig WRITE setEditFormConfig NOTIFY editFormConfigChanged )
400  Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly NOTIFY readOnlyChanged )
401  Q_PROPERTY( bool supportsEditing READ supportsEditing NOTIFY supportsEditingChanged )
402 
403  public:
404 
407  {
408  Success = 0,
409  EmptyGeometry = 1,
410  EditFailed = 2,
411  FetchFeatureFailed = 3,
412  InvalidLayer = 4,
413  };
414  Q_ENUM( EditResult )
415 
416 
418  {
423  };
424  Q_ENUM( SelectBehavior )
425 
426 
431  {
432 
436  explicit LayerOptions( bool loadDefaultStyle = true,
437  bool readExtentFromXml = false )
438  : loadDefaultStyle( loadDefaultStyle )
439  , readExtentFromXml( readExtentFromXml )
440  {}
441 
446  explicit LayerOptions( const QgsCoordinateTransformContext &transformContext,
447  bool loadDefaultStyle = true,
448  bool readExtentFromXml = false
449  )
450  : loadDefaultStyle( loadDefaultStyle )
451  , readExtentFromXml( readExtentFromXml )
452  , transformContext( transformContext )
453  {}
454 
456  bool loadDefaultStyle = true;
457 
462  bool readExtentFromXml = false;
463 
469 
482 
495 
509  bool skipCrsValidation = false;
510 
511  };
512 
517  struct CORE_EXPORT DeleteContext
518  {
519 
523  explicit DeleteContext( bool cascade = false, QgsProject *project = nullptr ): cascade( cascade ), project( project ) {}
524 
531  QList<QgsVectorLayer *> handledLayers( bool includeAuxiliaryLayers = true ) const;
532 
536  QgsFeatureIds handledFeatures( QgsVectorLayer *layer ) const;
537 
538  QMap<QgsVectorLayer *, QgsFeatureIds> mHandledFeatures SIP_SKIP;
539  bool cascade;
541  };
542 
556  explicit QgsVectorLayer( const QString &path = QString(), const QString &baseName = QString(),
557  const QString &providerLib = "ogr", const QgsVectorLayer::LayerOptions &options = QgsVectorLayer::LayerOptions() );
558 
559  ~QgsVectorLayer() override;
560 
562  QgsVectorLayer( const QgsVectorLayer &rhs ) = delete;
564  QgsVectorLayer &operator=( QgsVectorLayer const &rhs ) = delete;
565 
566 #ifdef SIP_RUN
567  SIP_PYOBJECT __repr__();
568  % MethodCode
569  QString str = QStringLiteral( "<QgsVectorLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
570  sipRes = PyUnicode_FromString( str.toUtf8().constData() );
571  % End
572 #endif
573 
582  QgsVectorLayer *clone() const override SIP_FACTORY;
583 
588  QString storageType() const;
589 
593  QString capabilitiesString() const;
594 
598  QString dataComment() const;
599 
607  QString displayField() const;
608 
616  void setDisplayExpression( const QString &displayExpression );
617 
624  QString displayExpression() const;
625 
626  QgsVectorDataProvider *dataProvider() FINAL;
627  const QgsVectorDataProvider *dataProvider() const FINAL SIP_SKIP;
628 
632  QgsMapLayerTemporalProperties *temporalProperties() override;
633 
644  void setProviderEncoding( const QString &encoding );
645 
647  void setCoordinateSystem();
648 
654  bool addJoin( const QgsVectorLayerJoinInfo &joinInfo );
655 
660  bool removeJoin( const QString &joinLayerId );
661 
666  QgsVectorLayerJoinBuffer *joinBuffer() { return mJoinBuffer; }
667 
672  const QgsVectorLayerJoinBuffer *joinBuffer() const { return mJoinBuffer; } SIP_SKIP;
673 
674  const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
675 
684  bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) FINAL;
685 
693  QSet<QgsMapLayerDependency> dependencies() const FINAL;
694 
705  int addExpressionField( const QString &exp, const QgsField &fld );
706 
714  void removeExpressionField( int index );
715 
725  QString expressionField( int index ) const;
726 
736  void updateExpressionField( int index, const QString &exp );
737 
744  QgsActionManager *actions() { return mActions; }
745 
751  const QgsActionManager *actions() const SIP_SKIP { return mActions; }
752 
757  QgsVectorLayerServerProperties *serverProperties() const { return mServerProperties.get(); }
758 
764  int selectedFeatureCount() const;
765 
775  Q_INVOKABLE void selectByRect( QgsRectangle &rect, QgsVectorLayer::SelectBehavior behavior = QgsVectorLayer::SetSelection );
776 
786  Q_INVOKABLE void selectByExpression( const QString &expression, QgsVectorLayer::SelectBehavior behavior = QgsVectorLayer::SetSelection );
787 
798  Q_INVOKABLE void selectByIds( const QgsFeatureIds &ids, QgsVectorLayer::SelectBehavior behavior = QgsVectorLayer::SetSelection );
799 
811  Q_INVOKABLE void modifySelection( const QgsFeatureIds &selectIds, const QgsFeatureIds &deselectIds );
812 
814  Q_INVOKABLE void invertSelection();
815 
817  Q_INVOKABLE void selectAll();
818 
826  Q_INVOKABLE void invertSelectionInRectangle( QgsRectangle &rect );
827 
840  Q_INVOKABLE QgsFeatureList selectedFeatures() const;
841 
857  QgsFeatureIterator getSelectedFeatures( QgsFeatureRequest request = QgsFeatureRequest() ) const;
858 
866  Q_INVOKABLE const QgsFeatureIds &selectedFeatureIds() const;
867 
869  Q_INVOKABLE QgsRectangle boundingBoxOfSelected() const;
870 
878  bool labelsEnabled() const;
879 
889  void setLabelsEnabled( bool enabled );
890 
896  bool diagramsEnabled() const;
897 
899  void setDiagramRenderer( QgsDiagramRenderer *r SIP_TRANSFER );
900  const QgsDiagramRenderer *diagramRenderer() const { return mDiagramRenderer; }
901 
902  void setDiagramLayerSettings( const QgsDiagramLayerSettings &s );
903  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
904 
911  QgsFeatureRenderer *renderer() { return mRenderer; }
912 
920  const QgsFeatureRenderer *renderer() const SIP_SKIP { return mRenderer; }
921 
928  void setRenderer( QgsFeatureRenderer *r SIP_TRANSFER );
929 
939  void addFeatureRendererGenerator( QgsFeatureRendererGenerator *generator SIP_TRANSFER );
940 
950  void removeFeatureRendererGenerator( const QString &id );
951 
959  QList< const QgsFeatureRendererGenerator * > featureRendererGenerators() const;
960 
962  Q_INVOKABLE QgsWkbTypes::GeometryType geometryType() const;
963 
965  Q_INVOKABLE QgsWkbTypes::Type wkbType() const FINAL;
966 
967  QgsCoordinateReferenceSystem sourceCrs() const FINAL;
968  QString sourceName() const FINAL;
969 
974  bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) FINAL;
975 
980  bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const FINAL;
981 
982  QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const FINAL;
983  QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const FINAL;
984 
989  void resolveReferences( QgsProject *project ) FINAL;
990 
999  virtual void saveStyleToDatabase( const QString &name, const QString &description,
1000  bool useAsDefault, const QString &uiFileContent,
1001  QString &msgError SIP_OUT );
1002 
1012  virtual int listStylesInDatabase( QStringList &ids SIP_OUT, QStringList &names SIP_OUT,
1013  QStringList &descriptions SIP_OUT, QString &msgError SIP_OUT );
1014 
1018  virtual QString getStyleFromDatabase( const QString &styleId, QString &msgError SIP_OUT );
1019 
1027  virtual bool deleteStyleFromDatabase( const QString &styleId, QString &msgError SIP_OUT );
1028 
1036  virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag SIP_OUT, bool loadFromLocalDb,
1037  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
1038 
1043  QString loadNamedStyle( const QString &theURI, bool &resultFlag SIP_OUT,
1044  QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1045 
1059  bool loadAuxiliaryLayer( const QgsAuxiliaryStorage &storage, const QString &key = QString() );
1060 
1070  void setAuxiliaryLayer( QgsAuxiliaryLayer *layer SIP_TRANSFER = nullptr );
1071 
1077  QgsAuxiliaryLayer *auxiliaryLayer();
1078 
1084  const QgsAuxiliaryLayer *auxiliaryLayer() const SIP_SKIP;
1085 
1086  bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
1087  QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1088  bool readStyle( const QDomNode &node, QString &errorMessage,
1089  QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
1090  bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1091  const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
1092  bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
1093  const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
1094 
1103  bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const;
1104 
1105  bool readSld( const QDomNode &node, QString &errorMessage ) FINAL;
1106 
1112  long featureCount( const QString &legendKey ) const;
1113 
1120  QgsFeatureIds symbolFeatureIds( const QString &legendKey ) const;
1121 
1132  FeatureAvailability hasFeatures() const FINAL;
1133 
1145  Q_DECL_DEPRECATED void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, bool loadDefaultStyleFlag = false ) SIP_DEPRECATED;
1146 
1159  void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false ) override;
1160 
1161  QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
1162 
1176  QgsVectorLayerFeatureCounter *countSymbolFeatures( bool storeSymbolFids = false );
1177 
1185  virtual bool setSubsetString( const QString &subset );
1186 
1191  virtual QString subsetString() const;
1192 
1198  QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const FINAL;
1199 
1203  inline QgsFeatureIterator getFeatures( const QString &expression )
1204  {
1205  return getFeatures( QgsFeatureRequest( expression ) );
1206  }
1207 
1212  inline QgsFeature getFeature( QgsFeatureId fid ) const
1213  {
1214  QgsFeature feature;
1215  getFeatures( QgsFeatureRequest( fid ) ).nextFeature( feature );
1216  return feature;
1217  }
1218 
1223  QgsGeometry getGeometry( QgsFeatureId fid ) const;
1224 
1229  {
1230  return getFeatures( QgsFeatureRequest( fids ) );
1231  }
1232 
1236  inline QgsFeatureIterator getFeatures( const QgsRectangle &rectangle )
1237  {
1238  return getFeatures( QgsFeatureRequest( rectangle ) );
1239  }
1240 
1241  bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) FINAL;
1242 
1268  bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
1269 
1281  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
1282 
1294  bool insertVertex( const QgsPoint &point, QgsFeatureId atFeatureId, int beforeVertex );
1295 
1306  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
1307 
1318  bool moveVertex( const QgsPoint &p, QgsFeatureId atFeatureId, int atVertex ) SIP_PYNAME( moveVertexV2 );
1319 
1330  EditResult deleteVertex( QgsFeatureId featureId, int vertex );
1331 
1339  Q_INVOKABLE bool deleteSelectedFeatures( int *deletedCount = nullptr, DeleteContext *context = nullptr );
1340 
1361  Q_DECL_DEPRECATED QgsGeometry::OperationResult addRing( const QVector<QgsPointXY> &ring, QgsFeatureId *featureId = nullptr ) SIP_DEPRECATED;
1362 
1363 
1383  Q_INVOKABLE QgsGeometry::OperationResult addRing( const QgsPointSequence &ring, QgsFeatureId *featureId = nullptr );
1384 
1405  Q_INVOKABLE QgsGeometry::OperationResult addRing( QgsCurve *ring SIP_TRANSFER, QgsFeatureId *featureId = nullptr ) SIP_PYNAME( addCurvedRing );
1406 
1426  Q_DECL_DEPRECATED QgsGeometry::OperationResult addPart( const QList<QgsPointXY> &ring ) SIP_DEPRECATED;
1427 
1428 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
1429 
1450  Q_DECL_DEPRECATED QgsGeometry::OperationResult addPart( const QVector<QgsPointXY> &ring ) SIP_PYNAME( addPartV2 ) SIP_DEPRECATED;
1451 #endif
1452 
1472  Q_INVOKABLE QgsGeometry::OperationResult addPart( const QgsPointSequence &ring ) SIP_PYNAME( addPartV2 );
1473 
1481  Q_INVOKABLE QgsGeometry::OperationResult addPart( QgsCurve *ring SIP_TRANSFER ) SIP_PYNAME( addCurvedPart );
1482 
1494  Q_INVOKABLE int translateFeature( QgsFeatureId featureId, double dx, double dy );
1495 
1516  Q_DECL_DEPRECATED QgsGeometry::OperationResult splitParts( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
1517 
1537  Q_INVOKABLE QgsGeometry::OperationResult splitParts( const QgsPointSequence &splitLine, bool topologicalEditing = false );
1538 
1559  Q_DECL_DEPRECATED QgsGeometry::OperationResult splitFeatures( const QVector<QgsPointXY> &splitLine, bool topologicalEditing = false ) SIP_DEPRECATED;
1560 
1580  Q_INVOKABLE QgsGeometry::OperationResult splitFeatures( const QgsPointSequence &splitLine, bool topologicalEditing = false );
1581 
1604  Q_INVOKABLE QgsGeometry::OperationResult splitFeatures( const QgsCurve *curve, QgsPointSequence &topologyTestPoints SIP_OUT, bool preserveCircular = false, bool topologicalEditing = false );
1605 
1616  int addTopologicalPoints( const QgsGeometry &geom );
1617 
1631  Q_DECL_DEPRECATED int addTopologicalPoints( const QgsPointXY &p ) SIP_DEPRECATED;
1632 
1646  int addTopologicalPoints( const QgsPoint &p );
1647 
1661  int addTopologicalPoints( const QgsPointSequence &ps );
1662 
1669  const QgsAbstractVectorLayerLabeling *labeling() const SIP_SKIP { return mLabeling; }
1670 
1677  QgsAbstractVectorLayerLabeling *labeling() { return mLabeling; }
1678 
1683  void setLabeling( QgsAbstractVectorLayerLabeling *labeling SIP_TRANSFER );
1684 
1686  bool isEditable() const FINAL;
1687 
1689  bool isSpatial() const FINAL;
1690 
1692  virtual bool isModified() const;
1693 
1700  bool isAuxiliaryField( int index, int &srcIndex ) const;
1701 
1703  void reload() FINAL;
1704 
1709  QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) FINAL SIP_FACTORY;
1710 
1711  QgsRectangle extent() const FINAL;
1712  QgsRectangle sourceExtent() const FINAL;
1713 
1720  QgsFields fields() const FINAL;
1721 
1725  inline QgsAttributeList attributeList() const { return mFields.allAttributesList(); }
1726 
1730  QgsAttributeList primaryKeyAttributes() const;
1731 
1737  long featureCount() const FINAL;
1738 
1743  bool setReadOnly( bool readonly = true );
1744 
1750  bool supportsEditing();
1751 
1772  bool changeGeometry( QgsFeatureId fid, QgsGeometry &geometry, bool skipDefaultValue = false );
1773 
1804  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant(), bool skipDefaultValues = false );
1805 
1841  bool changeAttributeValues( QgsFeatureId fid, const QgsAttributeMap &newValues, const QgsAttributeMap &oldValues = QgsAttributeMap(), bool skipDefaultValues = false );
1842 
1852  bool addAttribute( const QgsField &field );
1853 
1859  void setFieldAlias( int index, const QString &aliasString );
1860 
1866  void removeFieldAlias( int index );
1867 
1878  bool renameAttribute( int index, const QString &newName );
1879 
1886  QString attributeAlias( int index ) const;
1887 
1889  QString attributeDisplayName( int index ) const;
1890 
1892  QgsStringMap attributeAliases() const;
1893 
1898  Q_DECL_DEPRECATED QSet<QString> excludeAttributesWms() const SIP_DEPRECATED;
1899 
1904  Q_DECL_DEPRECATED void setExcludeAttributesWms( const QSet<QString> &att ) SIP_DEPRECATED;
1905 
1910  Q_DECL_DEPRECATED QSet<QString> excludeAttributesWfs() const SIP_DEPRECATED;
1911 
1916  Q_DECL_DEPRECATED void setExcludeAttributesWfs( const QSet<QString> &att ) SIP_DEPRECATED;
1917 
1926  virtual bool deleteAttribute( int attr );
1927 
1935  bool deleteAttributes( const QList<int> &attrs );
1936 
1937  bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = QgsFeatureSink::Flags() ) FINAL;
1938 
1949  bool deleteFeature( QgsFeatureId fid, DeleteContext *context = nullptr );
1950 
1964  bool deleteFeatures( const QgsFeatureIds &fids, DeleteContext *context = nullptr );
1965 
1989  Q_INVOKABLE bool commitChanges( bool stopEditing = true );
1990 
1996  QStringList commitErrors() const;
1997 
2007  Q_INVOKABLE bool rollBack( bool deleteBuffer = true );
2008 
2015  QList<QgsRelation> referencingRelations( int idx ) const;
2016 
2023  QList<QgsWeakRelation> weakRelations( ) const SIP_SKIP;
2024 
2025 
2027  Q_INVOKABLE QgsVectorLayerEditBuffer *editBuffer() { return mEditBuffer; }
2028 
2033  const QgsVectorLayerEditBuffer *editBuffer() const SIP_SKIP { return mEditBuffer; }
2034 
2039  void beginEditCommand( const QString &text );
2040 
2042  void endEditCommand();
2043 
2045  void destroyEditCommand();
2046 
2049  {
2052  NoMarker
2053  };
2054 
2059  Q_DECL_DEPRECATED static void drawVertexMarker( double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
2060 
2069  void updateFields();
2070 
2085  QVariant defaultValue( int index, const QgsFeature &feature = QgsFeature(),
2086  QgsExpressionContext *context = nullptr ) const;
2087 
2099  void setDefaultValueDefinition( int index, const QgsDefaultValue &definition );
2100 
2111  QgsDefaultValue defaultValueDefinition( int index ) const;
2112 
2120  QgsFieldConstraints::Constraints fieldConstraints( int fieldIndex ) const;
2121 
2127  QMap< QgsFieldConstraints::Constraint, QgsFieldConstraints::ConstraintStrength> fieldConstraintsAndStrength( int fieldIndex ) const;
2128 
2138 
2146  void removeFieldConstraint( int index, QgsFieldConstraints::Constraint constraint );
2147 
2155  QString constraintExpression( int index ) const;
2156 
2164  QString constraintDescription( int index ) const;
2165 
2174  void setConstraintExpression( int index, const QString &expression, const QString &description = QString() );
2175 
2181  void setFieldConfigurationFlags( int index, QgsField::ConfigurationFlags flags ) SIP_SKIP;
2182 
2187  void setFieldConfigurationFlag( int index, QgsField::ConfigurationFlag flag, bool active ) SIP_SKIP;
2188 
2194  QgsField::ConfigurationFlags fieldConfigurationFlags( int index ) const SIP_SKIP;
2195 
2199  void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
2200 
2207  QgsEditorWidgetSetup editorWidgetSetup( int index ) const;
2208 
2220  QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const FINAL;
2221 
2235  QStringList uniqueStringsMatching( int index, const QString &substring, int limit = -1,
2236  QgsFeedback *feedback = nullptr ) const;
2237 
2252  QVariant minimumValue( int index ) const FINAL;
2253 
2268  QVariant maximumValue( int index ) const FINAL;
2269 
2270 
2290  void minimumAndMaximumValue( int index, QVariant &minimum SIP_OUT, QVariant &maximum SIP_OUT ) const;
2291 
2304  QVariant aggregate( QgsAggregateCalculator::Aggregate aggregate,
2305  const QString &fieldOrExpression,
2306  const QgsAggregateCalculator::AggregateParameters &parameters = QgsAggregateCalculator::AggregateParameters(),
2307  QgsExpressionContext *context = nullptr,
2308  bool *ok = nullptr,
2309  QgsFeatureIds *fids = nullptr ) const;
2310 
2312  void setFeatureBlendMode( QPainter::CompositionMode blendMode );
2314  QPainter::CompositionMode featureBlendMode() const;
2315 
2316  QString htmlMetadata() const FINAL;
2317 
2322  void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
2323 
2328  inline const QgsVectorSimplifyMethod &simplifyMethod() const { return mSimplifyMethod; }
2329 
2335  bool simplifyDrawingCanbeApplied( const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
2336 
2344  QgsConditionalLayerStyles *conditionalStyles() const;
2345 
2350  QgsAttributeTableConfig attributeTableConfig() const;
2351 
2356  void setAttributeTableConfig( const QgsAttributeTableConfig &attributeTableConfig );
2357 
2365  QString mapTipTemplate() const;
2366 
2374  void setMapTipTemplate( const QString &mapTipTemplate );
2375 
2377 
2378  QgsExpressionContextScope *createExpressionContextScope() const FINAL SIP_FACTORY;
2379 
2387  QgsEditFormConfig editFormConfig() const;
2388 
2395  void setEditFormConfig( const QgsEditFormConfig &editFormConfig );
2396 
2404  void setReadExtentFromXml( bool readExtentFromXml );
2405 
2413  bool readExtentFromXml() const;
2414 
2420  bool isEditCommandActive() const { return mEditCommandActive; }
2421 
2427  QgsGeometryOptions *geometryOptions() const;
2428 
2446  bool allowCommit() const SIP_SKIP;
2447 
2465  void setAllowCommit( bool allowCommit ) SIP_SKIP;
2466 
2472  QgsStoredExpressionManager *storedExpressionManager() { return mStoredExpressionManager; }
2473 
2474  public slots:
2475 
2483  void select( QgsFeatureId featureId );
2484 
2492  Q_INVOKABLE void select( const QgsFeatureIds &featureIds );
2493 
2501  void deselect( QgsFeatureId featureId );
2502 
2510  Q_INVOKABLE void deselect( const QgsFeatureIds &featureIds );
2511 
2518  Q_INVOKABLE void removeSelection();
2519 
2530  void reselect();
2531 
2538  virtual void updateExtents( bool force = false );
2539 
2554  Q_INVOKABLE bool startEditing();
2555 
2561  virtual void setTransformContext( const QgsCoordinateTransformContext &transformContext ) override;
2562 
2563  SpatialIndexPresence hasSpatialIndex() const override;
2564 
2565  bool accept( QgsStyleEntityVisitorInterface *visitor ) const override;
2566 
2567  signals:
2568 
2576  void selectionChanged( const QgsFeatureIds &selected, const QgsFeatureIds &deselected, bool clearAndSelect );
2577 
2580 
2587 
2589  void beforeModifiedCheck() const;
2590 
2593 
2596 
2599 
2605  void beforeCommitChanges( bool stopEditing );
2606 
2609 
2615 
2621 
2630  void attributeAdded( int idx );
2631 
2638  void beforeAddingExpressionField( const QString &fieldName );
2639 
2648  void attributeDeleted( int idx );
2649 
2657 
2664 
2674 
2684  void featuresDeleted( const QgsFeatureIds &fids );
2685 
2691 
2697 
2706  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value );
2707 
2715  void geometryChanged( QgsFeatureId fid, const QgsGeometry &geometry );
2716 
2718  void committedAttributesDeleted( const QString &layerId, const QgsAttributeList &deletedAttributes );
2720  void committedAttributesAdded( const QString &layerId, const QList<QgsField> &addedAttributes );
2722  void committedFeaturesAdded( const QString &layerId, const QgsFeatureList &addedFeatures );
2724  void committedFeaturesRemoved( const QString &layerId, const QgsFeatureIds &deletedFeatureIds );
2726  void committedAttributeValuesChanges( const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues );
2728  void committedGeometriesChanges( const QString &layerId, const QgsGeometryMap &changedGeometries );
2729 
2731  void labelingFontNotFound( QgsVectorLayer *layer, const QString &fontfamily );
2732 
2734  void featureBlendModeChanged( QPainter::CompositionMode blendMode );
2735 
2741  void editCommandStarted( const QString &text );
2742 
2749 
2756 
2766  void readCustomSymbology( const QDomElement &element, QString &errorMessage );
2767 
2777  void writeCustomSymbology( QDomElement &element, QDomDocument &doc, QString &errorMessage ) const;
2778 
2785 
2792 
2796  void raiseError( const QString &msg );
2797 
2804 
2812 
2819 
2826 
2827  protected:
2829  void setExtent( const QgsRectangle &rect ) FINAL;
2830 
2831  private slots:
2832  void invalidateSymbolCountedFlag();
2833  void onFeatureCounterCompleted();
2834  void onFeatureCounterTerminated();
2835  void onJoinedFieldsChanged();
2836  void onFeatureDeleted( QgsFeatureId fid );
2837  void onRelationsLoaded();
2838  void onSymbolsCounted();
2839  void onDirtyTransaction( const QString &sql, const QString &name );
2840  void emitDataChanged();
2841  void onAfterCommitChangesDependency();
2842 
2843  private:
2844  void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature() );
2845 
2849  bool isReadOnly() const FINAL;
2850 
2857  bool setDataProvider( QString const &provider, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
2858 
2860  void readSldLabeling( const QDomNode &node );
2861 
2863  bool readSldTextSymbolizer( const QDomNode &node, QgsPalLayerSettings &settings ) const;
2864 
2866  QgsAbstractVectorLayerLabeling *readLabelingFromCustomProperties();
2867 
2868  bool deleteFeatureCascade( QgsFeatureId fid, DeleteContext *context = nullptr );
2869 
2870 #ifdef SIP_RUN
2871  QgsVectorLayer( const QgsVectorLayer &rhs );
2872 #endif
2874  void minimumOrMaximumValue( int index, QVariant *minimum, QVariant *maximum ) const;
2875 
2876  QgsConditionalLayerStyles *mConditionalStyles = nullptr;
2877 
2879  QgsVectorDataProvider *mDataProvider = nullptr;
2880 
2882  QgsVectorLayerTemporalProperties *mTemporalProperties = nullptr;
2883 
2885  QString mDisplayExpression;
2886 
2887  QString mMapTipTemplate;
2888 
2890  QgsActionManager *mActions = nullptr;
2891 
2893  bool mReadOnly = false;
2894 
2900  QgsFeatureIds mSelectedFeatureIds;
2901 
2905  QgsFeatureIds mPreviousSelectedFeatureIds;
2906 
2908  QgsFields mFields;
2909 
2911  QgsStringMap mAttributeAliasMap;
2912 
2914  QMap<QString, QgsDefaultValue> mDefaultExpressionMap;
2915 
2917  QSet<int> mDefaultValueOnUpdateFields;
2918 
2920  QMap< QString, QgsFieldConstraints::Constraints > mFieldConstraints;
2921 
2923  QMap< QPair< QString, QgsFieldConstraints::Constraint >, QgsFieldConstraints::ConstraintStrength > mFieldConstraintStrength;
2924 
2926  QMap< QString, QPair< QString, QString > > mFieldConstraintExpressions;
2927 
2928  QMap< QString, QgsField::ConfigurationFlags > mFieldConfigurationFlags;
2929  QMap< QString, QgsEditorWidgetSetup > mFieldWidgetSetups;
2930 
2932  QgsEditFormConfig mEditFormConfig;
2933 
2936 
2938  QgsFeatureRenderer *mRenderer = nullptr;
2939 
2941  QgsVectorSimplifyMethod mSimplifyMethod;
2942 
2944  QgsAbstractVectorLayerLabeling *mLabeling = nullptr;
2945 
2947  bool mLabelsEnabled = false;
2948 
2950  bool mLabelFontNotFoundNotified = false;
2951 
2953  QPainter::CompositionMode mFeatureBlendMode = QPainter::CompositionMode_SourceOver;
2954 
2956  bool mVertexMarkerOnlyForSelection = false;
2957 
2958  QStringList mCommitErrors;
2959 
2961  QgsVectorLayerEditBuffer *mEditBuffer = nullptr;
2964 
2965  //stores information about joined layers
2966  QgsVectorLayerJoinBuffer *mJoinBuffer = nullptr;
2967 
2969  std::unique_ptr< QgsVectorLayerServerProperties > mServerProperties;
2970 
2972  QgsExpressionFieldBuffer *mExpressionFieldBuffer = nullptr;
2973 
2974  //diagram rendering object. 0 if diagram drawing is disabled
2975  QgsDiagramRenderer *mDiagramRenderer = nullptr;
2976 
2977  //stores infos about diagram placement (placement type, priority, position distance)
2978  QgsDiagramLayerSettings *mDiagramLayerSettings = nullptr;
2979 
2980  mutable bool mValidExtent = false;
2981  mutable bool mLazyExtent = true;
2982 
2984  std::unique_ptr<QgsAuxiliaryLayer> mAuxiliaryLayer;
2985 
2987  QString mAuxiliaryLayerKey;
2988 
2989  // Features in renderer classes counted
2990  bool mSymbolFeatureCounted = false;
2991 
2992  // Feature counts for each renderer legend key
2993  QHash<QString, long> mSymbolFeatureCountMap;
2994  QHash<QString, QgsFeatureIds> mSymbolFeatureIdMap;
2995 
2997  bool mEditCommandActive = false;
2998 
2999  bool mReadExtentFromXml;
3000  QgsRectangle mXmlExtent;
3001 
3002  QgsFeatureIds mDeletedFids;
3003 
3004  QgsAttributeTableConfig mAttributeTableConfig;
3005 
3006  mutable QMutex mFeatureSourceConstructorMutex;
3007 
3008  QgsVectorLayerFeatureCounter *mFeatureCounter = nullptr;
3009 
3010  std::unique_ptr<QgsGeometryOptions> mGeometryOptions;
3011 
3012  bool mAllowCommit = true;
3013 
3015  QgsStoredExpressionManager *mStoredExpressionManager = nullptr;
3016 
3018 
3020  bool mDataChangedFired = false;
3021 
3022  QList<QgsWeakRelation> mWeakRelations;
3023 
3024  bool mSetLegendFromStyle = false;
3025 
3026  QList< QgsFeatureRendererGenerator * > mRendererGenerators;
3027 };
3028 
3029 
3030 
3031 // clazy:excludeall=qstring-allocations
3032 
3033 #endif
Abstract base class for simplify geometries using a specific algorithm.
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.
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.
virtual QgsWkbTypes::Type 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 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 id, geometry and a list of field/values...
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:51
ConfigurationFlag
Configuration flags for fields These flags are meant to be user-configurable and are not describing a...
Definition: qgsfield.h:80
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:124
OperationResult
Success or failure of a geometry operation.
Definition: qgsgeometry.h:136
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:85
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:1779
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:44
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:38
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:99
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.
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:66
This is the base class for vector data providers.
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.
Manages QGIS Server properties for a vector layer.
Implementation of map layer temporal properties for vector layers.
Represents a vector layer which manages a vector based data sets.
const QgsActionManager * actions() const
Returns all layer actions defined on this layer.
VertexMarkerType
Editing vertex markers.
void committedFeaturesAdded(const QString &layerId, const QgsFeatureList &addedFeatures)
Emitted when features are added to the provider.
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.
QgsVectorLayerServerProperties * serverProperties() const
Returns QGIS Server Properties of the vector layer.
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.
void editingStopped()
Emitted when edited changes have been successfully written to the data provider.
void beforeCommitChanges(bool stopEditing)
Emitted before changes are committed to the data provider.
void mapTipTemplateChanged()
Emitted when the map tip changes.
void attributeAdded(int idx)
Will be emitted, when a new attribute has been added to this vector layer.
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.
QgsVectorLayer & operator=(QgsVectorLayer const &rhs)=delete
QgsVectorLayer cannot be copied.
void editCommandDestroyed()
Signal emitted, when an edit command is destroyed.
QgsVectorLayer(const QgsVectorLayer &rhs)=delete
QgsVectorLayer cannot be copied.
const QgsDiagramLayerSettings * diagramLayerSettings() const
void editingStarted()
Emitted when editing on this layer has started.
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.
void symbolFeatureCountMapChanged()
Emitted when the feature count for symbols on this layer has been recalculated.
EditResult
Result of an edit operation.
void writeCustomSymbology(QDomElement &element, QDomDocument &doc, QString &errorMessage) const
Signal emitted whenever the symbology (QML-file) for this layer is being written.
QgsAbstractVectorLayerLabeling * labeling()
Access to labeling configuration.
SelectBehavior
Selection behavior.
@ RemoveFromSelection
Remove from current selection.
@ IntersectSelection
Modify current selection to include only select features which match.
@ AddToSelection
Add selection to current selection.
@ SetSelection
Set selection, removing any existing selection.
void attributeDeleted(int idx)
Will be emitted, when an attribute has been deleted from this vector layer.
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.
void committedAttributesAdded(const QString &layerId, const QList< QgsField > &addedAttributes)
Emitted when attributes are added to the provider.
void committedAttributesDeleted(const QString &layerId, const QgsAttributeList &deletedAttributes)
Emitted when attributes are deleted from the provider.
void displayExpressionChanged()
Emitted when the display expression changes.
void layerModified()
Emitted when modifications has been done on 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.
const QgsFeatureRenderer * renderer() const
Returns the feature renderer used for rendering the features in the layer in 2D map views.
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 QgsVectorLayerJoinBuffer * joinBuffer() const
Returns a const pointer on join buffer object.
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.
void beforeRollBack()
Emitted before changes are rolled back.
const QgsDiagramRenderer * diagramRenderer() const
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 QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
void beforeModifiedCheck() const
Emitted when the layer is checked for modifications. Use for last-minute additions.
const QgsVectorLayerEditBuffer * editBuffer() const
Buffer with uncommitted editing operations.
QgsFeatureRenderer * renderer()
Returns the feature renderer used for rendering the features in the layer in 2D map views.
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...
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
QMap< QString, QString > QgsStringMap
Definition: qgis.h:748
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_SKIP
Definition: qgis_sip.h:126
#define FINAL
Definition: qgis_sip.h:228
#define SIP_PYNAME(name)
Definition: qgis_sip.h:81
#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:38
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:629
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:620
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:634
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:463
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.