Skip to content

Commit 8d9c96c

Browse files
committedSep 19, 2018
Add final for sip >= 4.19
1 parent d9f5d53 commit 8d9c96c

File tree

3 files changed

+42
-42
lines changed

3 files changed

+42
-42
lines changed
 

‎python/core/auto_generated/qgsvectorlayer.sip.in

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Uses :py:class:`QgsExpression`
404404
:return: The expression which will be used to preview features for this layer
405405
%End
406406

407-
QgsVectorDataProvider *dataProvider() final;
407+
QgsVectorDataProvider *dataProvider() ${SIP_FINAL};
408408

409409
void setProviderEncoding( const QString &encoding );
410410
%Docstring
@@ -442,7 +442,7 @@ Returns the join buffer object.
442442
%End
443443
const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
444444

445-
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) final;
445+
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) ${SIP_FINAL};
446446
%Docstring
447447
Sets the list of dependencies.
448448

@@ -455,7 +455,7 @@ Sets the list of dependencies.
455455
.. versionadded:: 3.0
456456
%End
457457

458-
QSet<QgsMapLayerDependency> dependencies() const final;
458+
QSet<QgsMapLayerDependency> dependencies() const ${SIP_FINAL};
459459
%Docstring
460460
Gets the list of dependencies. This includes data dependencies set by the user (:py:func:`setDataDependencies`)
461461
as well as dependencies given by the provider
@@ -721,7 +721,7 @@ Ownership is transferred.
721721
Returns point, line or polygon
722722
%End
723723

724-
QgsWkbTypes::Type wkbType() const final;
724+
QgsWkbTypes::Type wkbType() const ${SIP_FINAL};
725725
%Docstring
726726
Returns the WKBType or WKBUnknown in case of error
727727
%End
@@ -731,10 +731,10 @@ Returns the WKBType or WKBUnknown in case of error
731731
Returns the provider type for this layer
732732
%End
733733

734-
QgsCoordinateReferenceSystem sourceCrs() const final;
735-
QString sourceName() const final;
734+
QgsCoordinateReferenceSystem sourceCrs() const ${SIP_FINAL};
735+
QString sourceName() const ${SIP_FINAL};
736736

737-
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) final;
737+
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) ${SIP_FINAL};
738738
%Docstring
739739
Reads vector layer specific state from project file Dom node.
740740

@@ -743,7 +743,7 @@ Reads vector layer specific state from project file Dom node.
743743
Called by :py:func:`QgsMapLayer.readXml()`
744744
%End
745745

746-
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const final;
746+
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const ${SIP_FINAL};
747747
%Docstring
748748
Write vector layer specific state to project file Dom node.
749749

@@ -752,10 +752,10 @@ Write vector layer specific state to project file Dom node.
752752
Called by :py:func:`QgsMapLayer.writeXml()`
753753
%End
754754

755-
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const final;
756-
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const final;
755+
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const ${SIP_FINAL};
756+
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const ${SIP_FINAL};
757757

758-
void resolveReferences( QgsProject *project ) final;
758+
void resolveReferences( QgsProject *project ) ${SIP_FINAL};
759759
%Docstring
760760
Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
761761

@@ -821,7 +821,7 @@ Load a named style from file/local db/datasource db
821821
%End
822822

823823
QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/,
824-
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final;
824+
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
825825
%Docstring
826826
Calls loadNamedStyle( theURI, resultFlag, false );
827827
Retained for backward compatibility
@@ -862,7 +862,7 @@ Returns the current auxiliary layer.
862862

863863

864864
bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
865-
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final;
865+
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
866866
%Docstring
867867
Read the symbology for the current layer from the Dom node supplied.
868868

@@ -875,7 +875,7 @@ Read the symbology for the current layer from the Dom node supplied.
875875
%End
876876

877877
bool readStyle( const QDomNode &node, QString &errorMessage,
878-
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) final;
878+
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
879879
%Docstring
880880
Read the style for the current layer from the Dom node supplied.
881881

@@ -888,7 +888,7 @@ Read the style for the current layer from the Dom node supplied.
888888
%End
889889

890890
bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
891-
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const final;
891+
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
892892
%Docstring
893893
Write the symbology for the layer into the docment provided.
894894

@@ -902,7 +902,7 @@ Write the symbology for the layer into the docment provided.
902902
%End
903903

904904
bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
905-
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const final;
905+
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
906906
%Docstring
907907
Write just the style information for the layer into the document
908908

@@ -927,7 +927,7 @@ Writes the symbology of the layer into the document provided in SLD 1.1 format
927927
:return: true in case of success
928928
%End
929929

930-
bool readSld( const QDomNode &node, QString &errorMessage ) final;
930+
bool readSld( const QDomNode &node, QString &errorMessage ) ${SIP_FINAL};
931931

932932
long featureCount( const QString &legendKey ) const;
933933
%Docstring
@@ -937,7 +937,7 @@ calculated by countSymbolFeatures()
937937
:return: number of features rendered by symbol or -1 if failed or counts are not available
938938
%End
939939

940-
FeatureAvailability hasFeatures() const final;
940+
FeatureAvailability hasFeatures() const ${SIP_FINAL};
941941
%Docstring
942942
Determines if this vector layer has features.
943943

@@ -984,7 +984,7 @@ if the geometry type of the new data source matches the current geometry type of
984984
.. versionadded:: 3.2
985985
%End
986986

987-
QString loadDefaultStyle( bool &resultFlag /Out/ ) final;
987+
QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL};
988988

989989
QgsVectorLayerFeatureCounter *countSymbolFeatures();
990990
%Docstring
@@ -1020,7 +1020,7 @@ Returns the string (typically sql) used to define a subset of the layer.
10201020
:return: The subset string or null QString if not implemented by the provider
10211021
%End
10221022

1023-
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const final;
1023+
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const ${SIP_FINAL};
10241024
%Docstring
10251025
Query the layer for features specified in request.
10261026

@@ -1050,7 +1050,7 @@ Query the layer for the features with the given ids.
10501050
Query the layer for the features which intersect the specified rectangle.
10511051
%End
10521052

1053-
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) final;
1053+
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
10541054

10551055
bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
10561056
%Docstring
@@ -1412,12 +1412,12 @@ Set labeling configuration. Takes ownership of the object.
14121412
.. versionadded:: 3.0
14131413
%End
14141414

1415-
bool isEditable() const final;
1415+
bool isEditable() const ${SIP_FINAL};
14161416
%Docstring
14171417
Returns true if the provider is in editing mode
14181418
%End
14191419

1420-
bool isSpatial() const final;
1420+
bool isSpatial() const ${SIP_FINAL};
14211421
%Docstring
14221422
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
14231423
%End
@@ -1435,22 +1435,22 @@ false otherwise.
14351435
.. versionadded:: 3.0
14361436
%End
14371437

1438-
void reload() final;
1438+
void reload() ${SIP_FINAL};
14391439
%Docstring
14401440
Synchronises with changes in the datasource
14411441
%End
14421442

1443-
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) final /Factory/;
1443+
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) ${SIP_FINAL} /Factory/;
14441444
%Docstring
14451445
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context
14461446

14471447
.. versionadded:: 2.4
14481448
%End
14491449

1450-
QgsRectangle extent() const final;
1451-
QgsRectangle sourceExtent() const final;
1450+
QgsRectangle extent() const ${SIP_FINAL};
1451+
QgsRectangle sourceExtent() const ${SIP_FINAL};
14521452

1453-
QgsFields fields() const final;
1453+
QgsFields fields() const ${SIP_FINAL};
14541454
%Docstring
14551455
Returns the list of fields of this layer.
14561456
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()
14681468
Returns the list of attributes which make up the layer's primary keys.
14691469
%End
14701470

1471-
long featureCount() const final;
1471+
long featureCount() const ${SIP_FINAL};
14721472
%Docstring
14731473
Returns feature count including changes which have not yet been committed
14741474
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)
16921692
:return: true if at least one attribute has been deleted
16931693
%End
16941694

1695-
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) final;
1695+
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
16961696

16971697
bool deleteFeature( QgsFeatureId fid );
16981698
%Docstring
@@ -1975,7 +1975,7 @@ for the field at `index`.
19751975
.. versionadded:: 3.0
19761976
%End
19771977

1978-
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const final;
1978+
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL};
19791979
%Docstring
19801980
Calculates a list of unique values contained within an attribute in the layer. Note that
19811981
in some circumstances when unsaved changes are present for the layer then the returned list
@@ -2009,7 +2009,7 @@ returned list).
20092009
:return: list of unique strings containing substring
20102010
%End
20112011

2012-
QVariant minimumValue( int index ) const final;
2012+
QVariant minimumValue( int index ) const ${SIP_FINAL};
20132013
%Docstring
20142014
Returns the minimum value for an attribute column or an invalid variant in case of error.
20152015
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
20212021
.. seealso:: :py:func:`uniqueValues`
20222022
%End
20232023

2024-
QVariant maximumValue( int index ) const final;
2024+
QVariant maximumValue( int index ) const ${SIP_FINAL};
20252025
%Docstring
20262026
Returns the maximum value for an attribute column or an invalid variant in case of error.
20272027
Note that in some circumstances when unsaved changes are present for the layer then the
@@ -2085,7 +2085,7 @@ and 1.0 (fully opaque).
20852085
.. versionadded:: 3.0
20862086
%End
20872087

2088-
QString htmlMetadata() const final;
2088+
QString htmlMetadata() const ${SIP_FINAL};
20892089

20902090
void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod );
20912091
%Docstring
@@ -2153,9 +2153,9 @@ It may also contain embedded expressions.
21532153
.. versionadded:: 3.0
21542154
%End
21552155

2156-
QgsExpressionContext createExpressionContext() const final;
2156+
QgsExpressionContext createExpressionContext() const ${SIP_FINAL};
21572157

2158-
QgsExpressionContextScope *createExpressionContextScope() const final /Factory/;
2158+
QgsExpressionContextScope *createExpressionContextScope() const ${SIP_FINAL} /Factory/;
21592159

21602160
QgsEditFormConfig editFormConfig() const;
21612161
%Docstring
@@ -2566,7 +2566,7 @@ Emitted when the feature count for symbols on this layer has been recalculated.
25662566
%End
25672567

25682568
protected:
2569-
void setExtent( const QgsRectangle &rect ) final;
2569+
void setExtent( const QgsRectangle &rect ) ${SIP_FINAL};
25702570
%Docstring
25712571
Sets the extent
25722572
%End

‎scripts/sipify.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ sub detect_non_method_member{
965965
do {no warnings 'uninitialized';
966966
$LINE =~ s/^(\s*template\s*<)(?:class|typename) (\w+>)(.*)$/$1$2$3/;
967967
$LINE =~ s/\s*\boverride\b//;
968-
$LINE =~ s/\s*\bSIP_FINAL\b/ final/;
968+
$LINE =~ s/\s*\bSIP_FINAL\b/ \${SIP_FINAL}/;
969969
$LINE =~ s/\s*\bextern \b//;
970970
$LINE =~ s/\s*\bMAYBE_UNUSED \b//;
971971
$LINE =~ s/\s*\bNODISCARD \b//;

‎src/core/qgsvectorlayer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,6 +2326,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
23262326
*/
23272327
void symbolFeatureCountMapChanged();
23282328

2329+
protected:
2330+
//! Sets the extent
2331+
void setExtent( const QgsRectangle &rect ) SIP_FINAL;
2332+
23292333
private slots:
23302334
void invalidateSymbolCountedFlag();
23312335
void onFeatureCounterCompleted();
@@ -2336,10 +2340,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
23362340
void onSymbolsCounted();
23372341
void onDirtyTransaction( const QString &sql, const QString &name );
23382342

2339-
protected:
2340-
//! Sets the extent
2341-
void setExtent( const QgsRectangle &rect ) SIP_FINAL;
2342-
23432343
private:
23442344
void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature() );
23452345

0 commit comments

Comments
 (0)
Please sign in to comment.