Skip to content

Commit 68dc698

Browse files
m-kuhnjef-n
authored andcommittedSep 20, 2018
Fix build with sip pre 4.19
1 parent 6e02f9f commit 68dc698

File tree

3 files changed

+72
-37
lines changed

3 files changed

+72
-37
lines changed
 

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

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414

1515

16+
1617
typedef QList<int> QgsAttributeList;
1718
typedef QSet<int> QgsAttributeIds;
1819

@@ -404,7 +405,8 @@ Uses :py:class:`QgsExpression`
404405
:return: The expression which will be used to preview features for this layer
405406
%End
406407

407-
QgsVectorDataProvider *dataProvider() ${SIP_FINAL};
408+
virtual QgsVectorDataProvider *dataProvider() ${SIP_FINAL};
409+
408410

409411
void setProviderEncoding( const QString &encoding );
410412
%Docstring
@@ -442,7 +444,8 @@ Returns the join buffer object.
442444
%End
443445
const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
444446

445-
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) ${SIP_FINAL};
447+
virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) ${SIP_FINAL};
448+
446449
%Docstring
447450
Sets the list of dependencies.
448451

@@ -455,7 +458,8 @@ Sets the list of dependencies.
455458
.. versionadded:: 3.0
456459
%End
457460

458-
QSet<QgsMapLayerDependency> dependencies() const ${SIP_FINAL};
461+
virtual QSet<QgsMapLayerDependency> dependencies() const ${SIP_FINAL};
462+
459463
%Docstring
460464
Gets the list of dependencies. This includes data dependencies set by the user (:py:func:`setDataDependencies`)
461465
as well as dependencies given by the provider
@@ -721,7 +725,8 @@ Ownership is transferred.
721725
Returns point, line or polygon
722726
%End
723727

724-
QgsWkbTypes::Type wkbType() const ${SIP_FINAL};
728+
virtual QgsWkbTypes::Type wkbType() const ${SIP_FINAL};
729+
725730
%Docstring
726731
Returns the WKBType or WKBUnknown in case of error
727732
%End
@@ -731,10 +736,13 @@ Returns the WKBType or WKBUnknown in case of error
731736
Returns the provider type for this layer
732737
%End
733738

734-
QgsCoordinateReferenceSystem sourceCrs() const ${SIP_FINAL};
735-
QString sourceName() const ${SIP_FINAL};
739+
virtual QgsCoordinateReferenceSystem sourceCrs() const ${SIP_FINAL};
740+
741+
virtual QString sourceName() const ${SIP_FINAL};
742+
743+
744+
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) ${SIP_FINAL};
736745

737-
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) ${SIP_FINAL};
738746
%Docstring
739747
Reads vector layer specific state from project file Dom node.
740748

@@ -743,7 +751,8 @@ Reads vector layer specific state from project file Dom node.
743751
Called by :py:func:`QgsMapLayer.readXml()`
744752
%End
745753

746-
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const ${SIP_FINAL};
754+
virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const ${SIP_FINAL};
755+
747756
%Docstring
748757
Write vector layer specific state to project file Dom node.
749758

@@ -752,10 +761,13 @@ Write vector layer specific state to project file Dom node.
752761
Called by :py:func:`QgsMapLayer.writeXml()`
753762
%End
754763

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};
764+
virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const ${SIP_FINAL};
765+
766+
virtual QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const ${SIP_FINAL};
767+
768+
769+
virtual void resolveReferences( QgsProject *project ) ${SIP_FINAL};
757770

758-
void resolveReferences( QgsProject *project ) ${SIP_FINAL};
759771
%Docstring
760772
Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
761773

@@ -820,7 +832,7 @@ Load a named style from file/local db/datasource db
820832
:param categories: the style categories to be loaded.
821833
%End
822834

823-
QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/,
835+
virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/,
824836
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
825837
%Docstring
826838
Calls loadNamedStyle( theURI, resultFlag, false );
@@ -861,7 +873,7 @@ Returns the current auxiliary layer.
861873
%End
862874

863875

864-
bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
876+
virtual bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
865877
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
866878
%Docstring
867879
Read the symbology for the current layer from the Dom node supplied.
@@ -874,7 +886,7 @@ Read the symbology for the current layer from the Dom node supplied.
874886
:return: true in case of success.
875887
%End
876888

877-
bool readStyle( const QDomNode &node, QString &errorMessage,
889+
virtual bool readStyle( const QDomNode &node, QString &errorMessage,
878890
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
879891
%Docstring
880892
Read the style for the current layer from the Dom node supplied.
@@ -887,7 +899,7 @@ Read the style for the current layer from the Dom node supplied.
887899
:return: true in case of success.
888900
%End
889901

890-
bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
902+
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
891903
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
892904
%Docstring
893905
Write the symbology for the layer into the docment provided.
@@ -901,7 +913,7 @@ Write the symbology for the layer into the docment provided.
901913
:return: true in case of success.
902914
%End
903915

904-
bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
916+
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
905917
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
906918
%Docstring
907919
Write just the style information for the layer into the document
@@ -927,7 +939,8 @@ Writes the symbology of the layer into the document provided in SLD 1.1 format
927939
:return: true in case of success
928940
%End
929941

930-
bool readSld( const QDomNode &node, QString &errorMessage ) ${SIP_FINAL};
942+
virtual bool readSld( const QDomNode &node, QString &errorMessage ) ${SIP_FINAL};
943+
931944

932945
long featureCount( const QString &legendKey ) const;
933946
%Docstring
@@ -937,7 +950,8 @@ calculated by countSymbolFeatures()
937950
:return: number of features rendered by symbol or -1 if failed or counts are not available
938951
%End
939952

940-
FeatureAvailability hasFeatures() const ${SIP_FINAL};
953+
virtual FeatureAvailability hasFeatures() const ${SIP_FINAL};
954+
941955
%Docstring
942956
Determines if this vector layer has features.
943957

@@ -984,7 +998,8 @@ if the geometry type of the new data source matches the current geometry type of
984998
.. versionadded:: 3.2
985999
%End
9861000

987-
QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL};
1001+
virtual QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL};
1002+
9881003

9891004
QgsVectorLayerFeatureCounter *countSymbolFeatures();
9901005
%Docstring
@@ -1020,7 +1035,8 @@ Returns the string (typically sql) used to define a subset of the layer.
10201035
:return: The subset string or null QString if not implemented by the provider
10211036
%End
10221037

1023-
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const ${SIP_FINAL};
1038+
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const ${SIP_FINAL};
1039+
10241040
%Docstring
10251041
Query the layer for features specified in request.
10261042

@@ -1050,7 +1066,8 @@ Query the layer for the features with the given ids.
10501066
Query the layer for the features which intersect the specified rectangle.
10511067
%End
10521068

1053-
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
1069+
virtual bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
1070+
10541071

10551072
bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
10561073
%Docstring
@@ -1412,12 +1429,14 @@ Set labeling configuration. Takes ownership of the object.
14121429
.. versionadded:: 3.0
14131430
%End
14141431

1415-
bool isEditable() const ${SIP_FINAL};
1432+
virtual bool isEditable() const ${SIP_FINAL};
1433+
14161434
%Docstring
14171435
Returns true if the provider is in editing mode
14181436
%End
14191437

1420-
bool isSpatial() const ${SIP_FINAL};
1438+
virtual bool isSpatial() const ${SIP_FINAL};
1439+
14211440
%Docstring
14221441
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
14231442
%End
@@ -1435,22 +1454,27 @@ false otherwise.
14351454
.. versionadded:: 3.0
14361455
%End
14371456

1438-
void reload() ${SIP_FINAL};
1457+
virtual void reload() ${SIP_FINAL};
1458+
14391459
%Docstring
14401460
Synchronises with changes in the datasource
14411461
%End
14421462

1443-
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) ${SIP_FINAL} /Factory/;
1463+
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) ${SIP_FINAL} /Factory/;
1464+
14441465
%Docstring
14451466
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context
14461467

14471468
.. versionadded:: 2.4
14481469
%End
14491470

1450-
QgsRectangle extent() const ${SIP_FINAL};
1451-
QgsRectangle sourceExtent() const ${SIP_FINAL};
1471+
virtual QgsRectangle extent() const ${SIP_FINAL};
1472+
1473+
virtual QgsRectangle sourceExtent() const ${SIP_FINAL};
1474+
1475+
1476+
virtual QgsFields fields() const ${SIP_FINAL};
14521477

1453-
QgsFields fields() const ${SIP_FINAL};
14541478
%Docstring
14551479
Returns the list of fields of this layer.
14561480
This also includes fields which have not yet been saved to the provider.
@@ -1468,7 +1492,8 @@ Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
14681492
Returns the list of attributes which make up the layer's primary keys.
14691493
%End
14701494

1471-
long featureCount() const ${SIP_FINAL};
1495+
virtual long featureCount() const ${SIP_FINAL};
1496+
14721497
%Docstring
14731498
Returns feature count including changes which have not yet been committed
14741499
If you need only the count of committed features call this method on this layer's provider.
@@ -1692,7 +1717,8 @@ Deletes a list of attribute fields (but does not commit it)
16921717
:return: true if at least one attribute has been deleted
16931718
%End
16941719

1695-
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
1720+
virtual bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
1721+
16961722

16971723
bool deleteFeature( QgsFeatureId fid );
16981724
%Docstring
@@ -1975,7 +2001,8 @@ for the field at `index`.
19752001
.. versionadded:: 3.0
19762002
%End
19772003

1978-
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL};
2004+
virtual QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL};
2005+
19792006
%Docstring
19802007
Calculates a list of unique values contained within an attribute in the layer. Note that
19812008
in some circumstances when unsaved changes are present for the layer then the returned list
@@ -2009,7 +2036,8 @@ returned list).
20092036
:return: list of unique strings containing substring
20102037
%End
20112038

2012-
QVariant minimumValue( int index ) const ${SIP_FINAL};
2039+
virtual QVariant minimumValue( int index ) const ${SIP_FINAL};
2040+
20132041
%Docstring
20142042
Returns the minimum value for an attribute column or an invalid variant in case of error.
20152043
Note that in some circumstances when unsaved changes are present for the layer then the
@@ -2021,7 +2049,8 @@ been changed inside the edit buffer then the previous saved value may be returne
20212049
.. seealso:: :py:func:`uniqueValues`
20222050
%End
20232051

2024-
QVariant maximumValue( int index ) const ${SIP_FINAL};
2052+
virtual QVariant maximumValue( int index ) const ${SIP_FINAL};
2053+
20252054
%Docstring
20262055
Returns the maximum value for an attribute column or an invalid variant in case of error.
20272056
Note that in some circumstances when unsaved changes are present for the layer then the
@@ -2085,7 +2114,8 @@ and 1.0 (fully opaque).
20852114
.. versionadded:: 3.0
20862115
%End
20872116

2088-
QString htmlMetadata() const ${SIP_FINAL};
2117+
virtual QString htmlMetadata() const ${SIP_FINAL};
2118+
20892119

20902120
void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod );
20912121
%Docstring
@@ -2153,9 +2183,11 @@ It may also contain embedded expressions.
21532183
.. versionadded:: 3.0
21542184
%End
21552185

2156-
QgsExpressionContext createExpressionContext() const ${SIP_FINAL};
2186+
virtual QgsExpressionContext createExpressionContext() const ${SIP_FINAL};
2187+
2188+
2189+
virtual QgsExpressionContextScope *createExpressionContextScope() const ${SIP_FINAL} /Factory/;
21572190

2158-
QgsExpressionContextScope *createExpressionContextScope() const ${SIP_FINAL} /Factory/;
21592191

21602192
QgsEditFormConfig editFormConfig() const;
21612193
%Docstring
@@ -2566,7 +2598,8 @@ Emitted when the feature count for symbols on this layer has been recalculated.
25662598
%End
25672599

25682600
protected:
2569-
void setExtent( const QgsRectangle &rect ) ${SIP_FINAL};
2601+
virtual void setExtent( const QgsRectangle &rect ) ${SIP_FINAL};
2602+
25702603
%Docstring
25712604
Sets the extent
25722605
%End

‎scripts/sipify.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,7 @@ sub detect_non_method_member{
960960
}
961961

962962
$IS_OVERRIDE = 1 if ( $LINE =~ m/\boverride\b/);
963+
$IS_OVERRIDE = 1 if ( $LINE =~ m/\bFINAL\b/);
963964

964965
# keyword fixes
965966
do {no warnings 'uninitialized';

‎src/core/qgsvectorlayer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef QGSVECTORLAYER_H
1919
#define QGSVECTORLAYER_H
2020

21+
2122
#include "qgis_core.h"
2223
#include <QMap>
2324
#include <QSet>

0 commit comments

Comments
 (0)
Please sign in to comment.