diff --git a/python/core/auto_generated/qgsvectorlayer.sip.in b/python/core/auto_generated/qgsvectorlayer.sip.in index 2981a6f4069..a3f16869c7e 100644 --- a/python/core/auto_generated/qgsvectorlayer.sip.in +++ b/python/core/auto_generated/qgsvectorlayer.sip.in @@ -404,7 +404,7 @@ Uses :py:class:`QgsExpression` :return: The expression which will be used to preview features for this layer %End - QgsVectorDataProvider *dataProvider() final; + QgsVectorDataProvider *dataProvider() ${SIP_FINAL}; void setProviderEncoding( const QString &encoding ); %Docstring @@ -442,7 +442,7 @@ Returns the join buffer object. %End const QList vectorJoins() const; - bool setDependencies( const QSet &layers ) final; + bool setDependencies( const QSet &layers ) ${SIP_FINAL}; %Docstring Sets the list of dependencies. @@ -455,7 +455,7 @@ Sets the list of dependencies. .. versionadded:: 3.0 %End - QSet dependencies() const final; + QSet dependencies() const ${SIP_FINAL}; %Docstring Gets the list of dependencies. This includes data dependencies set by the user (:py:func:`setDataDependencies`) as well as dependencies given by the provider @@ -721,7 +721,7 @@ Ownership is transferred. Returns point, line or polygon %End - QgsWkbTypes::Type wkbType() const final; + QgsWkbTypes::Type wkbType() const ${SIP_FINAL}; %Docstring Returns the WKBType or WKBUnknown in case of error %End @@ -731,10 +731,10 @@ Returns the WKBType or WKBUnknown in case of error Returns the provider type for this layer %End - QgsCoordinateReferenceSystem sourceCrs() const final; - QString sourceName() const final; + QgsCoordinateReferenceSystem sourceCrs() const ${SIP_FINAL}; + QString sourceName() const ${SIP_FINAL}; - bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) final; + bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) ${SIP_FINAL}; %Docstring Reads vector layer specific state from project file Dom node. @@ -743,7 +743,7 @@ Reads vector layer specific state from project file Dom node. Called by :py:func:`QgsMapLayer.readXml()` %End - bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const final; + bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const ${SIP_FINAL}; %Docstring Write vector layer specific state to project file Dom node. @@ -752,10 +752,10 @@ Write vector layer specific state to project file Dom node. Called by :py:func:`QgsMapLayer.writeXml()` %End - QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const final; - QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const final; + QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const ${SIP_FINAL}; + QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const ${SIP_FINAL}; - void resolveReferences( QgsProject *project ) final; + void resolveReferences( QgsProject *project ) ${SIP_FINAL}; %Docstring Resolve references to other layers (kept as layer IDs after reading XML) into layer objects. @@ -821,7 +821,7 @@ Load a named style from file/local db/datasource db %End QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/, - QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final; + QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL}; %Docstring Calls loadNamedStyle( theURI, resultFlag, false ); Retained for backward compatibility @@ -862,7 +862,7 @@ Returns the current auxiliary layer. bool readSymbology( const QDomNode &layerNode, QString &errorMessage, - QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final; + QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL}; %Docstring Read the symbology for the current layer from the Dom node supplied. @@ -875,7 +875,7 @@ Read the symbology for the current layer from the Dom node supplied. %End bool readStyle( const QDomNode &node, QString &errorMessage, - QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final; + QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL}; %Docstring Read the style for the current layer from the Dom node supplied. @@ -888,7 +888,7 @@ Read the style for the current layer from the Dom node supplied. %End bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, - const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const final; + const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL}; %Docstring Write the symbology for the layer into the docment provided. @@ -902,7 +902,7 @@ Write the symbology for the layer into the docment provided. %End bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, - const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const final; + const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL}; %Docstring Write just the style information for the layer into the document @@ -927,7 +927,7 @@ Writes the symbology of the layer into the document provided in SLD 1.1 format :return: true in case of success %End - bool readSld( const QDomNode &node, QString &errorMessage ) final; + bool readSld( const QDomNode &node, QString &errorMessage ) ${SIP_FINAL}; long featureCount( const QString &legendKey ) const; %Docstring @@ -937,7 +937,7 @@ calculated by countSymbolFeatures() :return: number of features rendered by symbol or -1 if failed or counts are not available %End - FeatureAvailability hasFeatures() const final; + FeatureAvailability hasFeatures() const ${SIP_FINAL}; %Docstring Determines if this vector layer has features. @@ -984,7 +984,7 @@ if the geometry type of the new data source matches the current geometry type of .. versionadded:: 3.2 %End - QString loadDefaultStyle( bool &resultFlag /Out/ ) final; + QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL}; QgsVectorLayerFeatureCounter *countSymbolFeatures(); %Docstring @@ -1020,7 +1020,7 @@ Returns the string (typically sql) used to define a subset of the layer. :return: The subset string or null QString if not implemented by the provider %End - QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const final; + QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const ${SIP_FINAL}; %Docstring Query the layer for features specified in request. @@ -1050,7 +1050,7 @@ Query the layer for the features with the given ids. Query the layer for the features which intersect the specified rectangle. %End - bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) final; + bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL}; bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false ); %Docstring @@ -1412,12 +1412,12 @@ Set labeling configuration. Takes ownership of the object. .. versionadded:: 3.0 %End - bool isEditable() const final; + bool isEditable() const ${SIP_FINAL}; %Docstring Returns true if the provider is in editing mode %End - bool isSpatial() const final; + bool isSpatial() const ${SIP_FINAL}; %Docstring Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry %End @@ -1435,22 +1435,22 @@ false otherwise. .. versionadded:: 3.0 %End - void reload() final; + void reload() ${SIP_FINAL}; %Docstring Synchronises with changes in the datasource %End - QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) final /Factory/; + QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) ${SIP_FINAL} /Factory/; %Docstring Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context .. versionadded:: 2.4 %End - QgsRectangle extent() const final; - QgsRectangle sourceExtent() const final; + QgsRectangle extent() const ${SIP_FINAL}; + QgsRectangle sourceExtent() const ${SIP_FINAL}; - QgsFields fields() const final; + QgsFields fields() const ${SIP_FINAL}; %Docstring Returns the list of fields of this layer. This also includes fields which have not yet been saved to the provider. @@ -1468,7 +1468,7 @@ Returns list of attribute indexes. i.e. a list from 0 ... fieldCount() Returns the list of attributes which make up the layer's primary keys. %End - long featureCount() const final; + long featureCount() const ${SIP_FINAL}; %Docstring Returns feature count including changes which have not yet been committed If you need only the count of committed features call this method on this layer's provider. @@ -1692,7 +1692,7 @@ Deletes a list of attribute fields (but does not commit it) :return: true if at least one attribute has been deleted %End - bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) final; + bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL}; bool deleteFeature( QgsFeatureId fid ); %Docstring @@ -1975,7 +1975,7 @@ for the field at `index`. .. versionadded:: 3.0 %End - QSet uniqueValues( int fieldIndex, int limit = -1 ) const final; + QSet uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL}; %Docstring Calculates a list of unique values contained within an attribute in the layer. Note that in some circumstances when unsaved changes are present for the layer then the returned list @@ -2009,7 +2009,7 @@ returned list). :return: list of unique strings containing substring %End - QVariant minimumValue( int index ) const final; + QVariant minimumValue( int index ) const ${SIP_FINAL}; %Docstring Returns the minimum value for an attribute column or an invalid variant in case of error. Note that in some circumstances when unsaved changes are present for the layer then the @@ -2021,7 +2021,7 @@ been changed inside the edit buffer then the previous saved value may be returne .. seealso:: :py:func:`uniqueValues` %End - QVariant maximumValue( int index ) const final; + QVariant maximumValue( int index ) const ${SIP_FINAL}; %Docstring Returns the maximum value for an attribute column or an invalid variant in case of error. Note that in some circumstances when unsaved changes are present for the layer then the @@ -2085,7 +2085,7 @@ and 1.0 (fully opaque). .. versionadded:: 3.0 %End - QString htmlMetadata() const final; + QString htmlMetadata() const ${SIP_FINAL}; void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod ); %Docstring @@ -2153,9 +2153,9 @@ It may also contain embedded expressions. .. versionadded:: 3.0 %End - QgsExpressionContext createExpressionContext() const final; + QgsExpressionContext createExpressionContext() const ${SIP_FINAL}; - QgsExpressionContextScope *createExpressionContextScope() const final /Factory/; + QgsExpressionContextScope *createExpressionContextScope() const ${SIP_FINAL} /Factory/; QgsEditFormConfig editFormConfig() const; %Docstring @@ -2566,7 +2566,7 @@ Emitted when the feature count for symbols on this layer has been recalculated. %End protected: - void setExtent( const QgsRectangle &rect ) final; + void setExtent( const QgsRectangle &rect ) ${SIP_FINAL}; %Docstring Sets the extent %End diff --git a/scripts/sipify.pl b/scripts/sipify.pl index 1313dd3a846..c110b993e36 100755 --- a/scripts/sipify.pl +++ b/scripts/sipify.pl @@ -965,7 +965,7 @@ while ($LINE_IDX < $LINE_COUNT){ do {no warnings 'uninitialized'; $LINE =~ s/^(\s*template\s*<)(?:class|typename) (\w+>)(.*)$/$1$2$3/; $LINE =~ s/\s*\boverride\b//; - $LINE =~ s/\s*\bSIP_FINAL\b/ final/; + $LINE =~ s/\s*\bSIP_FINAL\b/ \${SIP_FINAL}/; $LINE =~ s/\s*\bextern \b//; $LINE =~ s/\s*\bMAYBE_UNUSED \b//; $LINE =~ s/\s*\bNODISCARD \b//; diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h index d892e986142..e47bcfd3d72 100644 --- a/src/core/qgsvectorlayer.h +++ b/src/core/qgsvectorlayer.h @@ -2326,6 +2326,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte */ void symbolFeatureCountMapChanged(); + protected: + //! Sets the extent + void setExtent( const QgsRectangle &rect ) SIP_FINAL; + private slots: void invalidateSymbolCountedFlag(); void onFeatureCounterCompleted(); @@ -2336,10 +2340,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte void onSymbolsCounted(); void onDirtyTransaction( const QString &sql, const QString &name ); - protected: - //! Sets the extent - void setExtent( const QgsRectangle &rect ) SIP_FINAL; - private: void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature() );