Merge pull request #7948 from m-kuhn/final

It's the `final` countdown
This commit is contained in:
Matthias Kuhn 2018-09-19 16:34:54 +02:00 committed by GitHub
commit fde813ca82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 110 additions and 118 deletions

View File

@ -168,6 +168,12 @@ IF(${SIP_VERSION_STR} VERSION_GREATER 4.19.6)
SET(DOCSTRINGSTEMPLATE "")
ENDIF(${SIP_VERSION_STR} VERSION_GREATER 4.19.6)
IF(${SIP_VERSION_STR} VERSION_GREATER 4.19.0)
SET(SIP_FINAL "final")
ELSE(${SIP_VERSION_STR} VERSION_GREATER 4.19.0)
SET(SIP_FINAL "override")
ENDIF(${SIP_VERSION_STR} VERSION_GREATER 4.19.0)
# core module
FILE(GLOB_RECURSE sip_files_core core/*.sip core/*.sip.in)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core})

View File

@ -232,7 +232,6 @@ typedef unsigned long long qgssize;
/************************************************************************
* This file has been generated automatically from *
* *

View File

@ -404,8 +404,7 @@ Uses :py:class:`QgsExpression`
:return: The expression which will be used to preview features for this layer
%End
virtual QgsVectorDataProvider *dataProvider();
QgsVectorDataProvider *dataProvider() ${SIP_FINAL};
void setProviderEncoding( const QString &encoding );
%Docstring
@ -443,8 +442,7 @@ Returns the join buffer object.
%End
const QList<QgsVectorLayerJoinInfo> vectorJoins() const;
virtual bool setDependencies( const QSet<QgsMapLayerDependency> &layers );
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) ${SIP_FINAL};
%Docstring
Sets the list of dependencies.
@ -457,8 +455,7 @@ Sets the list of dependencies.
.. versionadded:: 3.0
%End
virtual QSet<QgsMapLayerDependency> dependencies() const;
QSet<QgsMapLayerDependency> 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
@ -724,8 +721,7 @@ Ownership is transferred.
Returns point, line or polygon
%End
virtual QgsWkbTypes::Type wkbType() const;
QgsWkbTypes::Type wkbType() const ${SIP_FINAL};
%Docstring
Returns the WKBType or WKBUnknown in case of error
%End
@ -735,13 +731,10 @@ Returns the WKBType or WKBUnknown in case of error
Returns the provider type for this layer
%End
virtual QgsCoordinateReferenceSystem sourceCrs() const;
virtual QString sourceName() const;
virtual bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context );
QgsCoordinateReferenceSystem sourceCrs() const ${SIP_FINAL};
QString sourceName() const ${SIP_FINAL};
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) ${SIP_FINAL};
%Docstring
Reads vector layer specific state from project file Dom node.
@ -750,8 +743,7 @@ Reads vector layer specific state from project file Dom node.
Called by :py:func:`QgsMapLayer.readXml()`
%End
virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const;
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const ${SIP_FINAL};
%Docstring
Write vector layer specific state to project file Dom node.
@ -760,13 +752,10 @@ Write vector layer specific state to project file Dom node.
Called by :py:func:`QgsMapLayer.writeXml()`
%End
virtual QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const;
virtual QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const;
virtual void resolveReferences( QgsProject *project );
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 ) ${SIP_FINAL};
%Docstring
Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
@ -831,8 +820,8 @@ Load a named style from file/local db/datasource db
:param categories: the style categories to be loaded.
%End
virtual QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/,
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
QString loadNamedStyle( const QString &theURI, bool &resultFlag /Out/,
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
%Docstring
Calls loadNamedStyle( theURI, resultFlag, false );
Retained for backward compatibility
@ -872,8 +861,8 @@ Returns the current auxiliary layer.
%End
virtual bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
%Docstring
Read the symbology for the current layer from the Dom node supplied.
@ -885,8 +874,8 @@ Read the symbology for the current layer from the Dom node supplied.
:return: true in case of success.
%End
virtual bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories );
bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) ${SIP_FINAL};
%Docstring
Read the style for the current layer from the Dom node supplied.
@ -898,8 +887,8 @@ Read the style for the current layer from the Dom node supplied.
:return: true in case of success.
%End
virtual bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
%Docstring
Write the symbology for the layer into the docment provided.
@ -912,8 +901,8 @@ Write the symbology for the layer into the docment provided.
:return: true in case of success.
%End
virtual bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const;
bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const ${SIP_FINAL};
%Docstring
Write just the style information for the layer into the document
@ -938,8 +927,7 @@ Writes the symbology of the layer into the document provided in SLD 1.1 format
:return: true in case of success
%End
virtual bool readSld( const QDomNode &node, QString &errorMessage );
bool readSld( const QDomNode &node, QString &errorMessage ) ${SIP_FINAL};
long featureCount( const QString &legendKey ) const;
%Docstring
@ -949,8 +937,7 @@ calculated by countSymbolFeatures()
:return: number of features rendered by symbol or -1 if failed or counts are not available
%End
virtual FeatureAvailability hasFeatures() const;
FeatureAvailability hasFeatures() const ${SIP_FINAL};
%Docstring
Determines if this vector layer has features.
@ -997,8 +984,7 @@ if the geometry type of the new data source matches the current geometry type of
.. versionadded:: 3.2
%End
virtual QString loadDefaultStyle( bool &resultFlag /Out/ );
QString loadDefaultStyle( bool &resultFlag /Out/ ) ${SIP_FINAL};
QgsVectorLayerFeatureCounter *countSymbolFeatures();
%Docstring
@ -1034,8 +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
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const ${SIP_FINAL};
%Docstring
Query the layer for features specified in request.
@ -1065,8 +1050,7 @@ Query the layer for the features with the given ids.
Query the layer for the features which intersect the specified rectangle.
%End
virtual bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 );
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
bool updateFeature( QgsFeature &feature, bool skipDefaultValues = false );
%Docstring
@ -1428,14 +1412,12 @@ Set labeling configuration. Takes ownership of the object.
.. versionadded:: 3.0
%End
virtual bool isEditable() const;
bool isEditable() const ${SIP_FINAL};
%Docstring
Returns true if the provider is in editing mode
%End
virtual bool isSpatial() const;
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
@ -1453,26 +1435,22 @@ false otherwise.
.. versionadded:: 3.0
%End
virtual void reload();
void reload() ${SIP_FINAL};
%Docstring
Synchronises with changes in the datasource
%End
virtual QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) /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
virtual QgsRectangle extent() const;
QgsRectangle extent() const ${SIP_FINAL};
QgsRectangle sourceExtent() const ${SIP_FINAL};
virtual QgsRectangle sourceExtent() const;
virtual QgsFields fields() const;
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.
@ -1490,8 +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
virtual long featureCount() const;
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.
@ -1715,8 +1692,7 @@ Deletes a list of attribute fields (but does not commit it)
:return: true if at least one attribute has been deleted
%End
virtual bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 );
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = 0 ) ${SIP_FINAL};
bool deleteFeature( QgsFeatureId fid );
%Docstring
@ -1999,8 +1975,7 @@ for the field at `index`.
.. versionadded:: 3.0
%End
virtual QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const;
QSet<QVariant> 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
@ -2034,8 +2009,7 @@ returned list).
:return: list of unique strings containing substring
%End
virtual QVariant minimumValue( int index ) const;
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
@ -2047,8 +2021,7 @@ been changed inside the edit buffer then the previous saved value may be returne
.. seealso:: :py:func:`uniqueValues`
%End
virtual QVariant maximumValue( int index ) const;
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
@ -2112,8 +2085,7 @@ and 1.0 (fully opaque).
.. versionadded:: 3.0
%End
virtual QString htmlMetadata() const;
QString htmlMetadata() const ${SIP_FINAL};
void setSimplifyMethod( const QgsVectorSimplifyMethod &simplifyMethod );
%Docstring
@ -2181,11 +2153,9 @@ It may also contain embedded expressions.
.. versionadded:: 3.0
%End
virtual QgsExpressionContext createExpressionContext() const;
virtual QgsExpressionContextScope *createExpressionContextScope() const /Factory/;
QgsExpressionContext createExpressionContext() const ${SIP_FINAL};
QgsExpressionContextScope *createExpressionContextScope() const ${SIP_FINAL} /Factory/;
QgsEditFormConfig editFormConfig() const;
%Docstring
@ -2596,8 +2566,7 @@ Emitted when the feature count for symbols on this layer has been recalculated.
%End
protected:
virtual void setExtent( const QgsRectangle &rect );
void setExtent( const QgsRectangle &rect ) ${SIP_FINAL};
%Docstring
Sets the extent
%End

View File

@ -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*\bfinal\b//;
$LINE =~ s/\s*\bFINAL\b/ \${SIP_FINAL}/;
$LINE =~ s/\s*\bextern \b//;
$LINE =~ s/\s*\bMAYBE_UNUSED \b//;
$LINE =~ s/\s*\bNODISCARD \b//;

View File

@ -636,6 +636,8 @@ typedef unsigned long long qgssize;
#define MAYBE_UNUSED
#endif
#ifndef FINAL
#define FINAL final
#endif

View File

@ -197,6 +197,17 @@
*/
#define SIP_DOC_TEMPLATE
/*
* Sip supports the final keyword since version 4.19.0, earlier than that
* we will have build issues because it tries to override final methods.
*/
#if SIP_VERSION < 0x041300
#if defined FINAL
#undef FINAL
#endif
#define FINAL override
#endif
/*
* Define Python special method (bool, repr, etc.) using the given method or code
* sipify.pl will create a dedicated python file named according to the class

View File

@ -2863,6 +2863,11 @@ bool QgsVectorLayer::deleteFeatures( const QgsFeatureIds &fids )
return res;
}
QgsFields QgsVectorLayer::fields() const
{
return mFields;
}
QgsAttributeList QgsVectorLayer::primaryKeyAttributes() const
{
QgsAttributeList pkAttributesList;

View File

@ -484,8 +484,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
QString displayExpression() const;
QgsVectorDataProvider *dataProvider() override;
const QgsVectorDataProvider *dataProvider() const override SIP_SKIP;
QgsVectorDataProvider *dataProvider() FINAL;
const QgsVectorDataProvider *dataProvider() const FINAL SIP_SKIP;
//! Sets the textencoding of the data provider
void setProviderEncoding( const QString &encoding );
@ -519,7 +519,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \returns false if a dependency cycle has been detected
* \since QGIS 3.0
*/
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) override;
bool setDependencies( const QSet<QgsMapLayerDependency> &layers ) FINAL;
/**
* Gets the list of dependencies. This includes data dependencies set by the user (\see setDataDependencies)
@ -528,7 +528,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \returns a set of QgsMapLayerDependency
* \since QGIS 3.0
*/
QSet<QgsMapLayerDependency> dependencies() const override;
QSet<QgsMapLayerDependency> dependencies() const FINAL;
/**
* Add a new field which is calculated by the expression specified
@ -752,34 +752,34 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
QgsWkbTypes::GeometryType geometryType() const;
//! Returns the WKBType or WKBUnknown in case of error
QgsWkbTypes::Type wkbType() const override;
QgsWkbTypes::Type wkbType() const FINAL;
//! Returns the provider type for this layer
QString providerType() const;
QgsCoordinateReferenceSystem sourceCrs() const override;
QString sourceName() const override;
QgsCoordinateReferenceSystem sourceCrs() const FINAL;
QString sourceName() const FINAL;
/**
* Reads vector layer specific state from project file Dom node.
* \note Called by QgsMapLayer::readXml().
*/
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) override;
bool readXml( const QDomNode &layer_node, QgsReadWriteContext &context ) FINAL;
/**
* Write vector layer specific state to project file Dom node.
* \note Called by QgsMapLayer::writeXml().
*/
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
bool writeXml( QDomNode &layer_node, QDomDocument &doc, const QgsReadWriteContext &context ) const FINAL;
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const override;
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const override;
QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const FINAL;
QString decodedSource( const QString &source, const QString &provider, const QgsReadWriteContext &context ) const FINAL;
/**
* Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
* \since QGIS 3.0
*/
void resolveReferences( QgsProject *project ) override;
void resolveReferences( QgsProject *project ) FINAL;
/**
* Save named and sld style of the layer to the style table in the db.
@ -834,7 +834,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* Retained for backward compatibility
*/
QString loadNamedStyle( const QString &theURI, bool &resultFlag SIP_OUT,
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) override;
QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
/**
* Loads the auxiliary layer for this vector layer. If there's no
@ -885,7 +885,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \returns true in case of success.
*/
bool readSymbology( const QDomNode &layerNode, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) override;
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
/**
* Read the style for the current layer from the Dom node supplied.
@ -896,7 +896,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \returns true in case of success.
*/
bool readStyle( const QDomNode &node, QString &errorMessage,
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) override;
QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) FINAL;
/**
* Write the symbology for the layer into the docment provided.
@ -908,7 +908,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \returns true in case of success.
*/
bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const override;
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
/**
* Write just the style information for the layer into the document
@ -920,7 +920,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \returns true in case of success.
*/
bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const override;
const QgsReadWriteContext &context, QgsMapLayer::StyleCategories categories = QgsMapLayer::AllStyleCategories ) const FINAL;
/**
* Writes the symbology of the layer into the document provided in SLD 1.1 format
@ -932,7 +932,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsStringMap &props = QgsStringMap() ) const;
bool readSld( const QDomNode &node, QString &errorMessage ) override;
bool readSld( const QDomNode &node, QString &errorMessage ) FINAL;
/**
* Number of features rendered with specified legend key. Features must be first
@ -951,7 +951,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*
* \since QGIS 3.4
*/
FeatureAvailability hasFeatures() const override;
FeatureAvailability hasFeatures() const FINAL;
/**
* Update the data source of the layer. The layer's renderer and legend will be preserved only
@ -980,7 +980,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
void setDataSource( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, bool loadDefaultStyleFlag = false );
QString loadDefaultStyle( bool &resultFlag SIP_OUT ) override;
QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
/**
* Count features for symbols.
@ -1016,7 +1016,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \param request feature request describing parameters of features to return
* \returns iterator for matching features from provider
*/
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const override;
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const FINAL;
/**
* Query the layer for features matching a given expression.
@ -1053,7 +1053,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
return getFeatures( QgsFeatureRequest( rectangle ) );
}
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = nullptr ) override;
bool addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags = nullptr ) FINAL;
/**
* Updates an existing \a feature in the layer, replacing the attributes and geometry for the feature
@ -1335,10 +1335,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
void setLabeling( QgsAbstractVectorLayerLabeling *labeling SIP_TRANSFER );
//! Returns true if the provider is in editing mode
bool isEditable() const override;
bool isEditable() const FINAL;
//! Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
bool isSpatial() const override;
bool isSpatial() const FINAL;
//! Returns true if the provider has been modified since the last commit
virtual bool isModified() const;
@ -1352,16 +1352,16 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
bool isAuxiliaryField( int index, int &srcIndex ) const;
//! Synchronises with changes in the datasource
void reload() override;
void reload() FINAL;
/**
* Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context
* \since QGIS 2.4
*/
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;
QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) FINAL SIP_FACTORY;
QgsRectangle extent() const override;
QgsRectangle sourceExtent() const override;
QgsRectangle extent() const FINAL;
QgsRectangle sourceExtent() const FINAL;
/**
* Returns the list of fields of this layer.
@ -1369,7 +1369,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*
* \returns A list of fields
*/
inline QgsFields fields() const override { return mFields; }
QgsFields fields() const FINAL;
/**
* Returns list of attribute indexes. i.e. a list from 0 ... fieldCount()
@ -1385,7 +1385,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* 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.
*/
long featureCount() const override;
long featureCount() const FINAL;
/**
* Make layer read-only (editing disabled) or not
@ -1574,7 +1574,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
bool deleteAttributes( const QList<int> &attrs );
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = nullptr ) override;
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = nullptr ) FINAL;
/**
* Deletes a feature from the layer (but does not commit it).
@ -1819,7 +1819,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \see minimumValue()
* \see maximumValue()
*/
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const override;
QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const FINAL;
/**
* Returns unique string values of an attribute which contain a specified subset string. Subset
@ -1845,7 +1845,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \see maximumValue()
* \see uniqueValues()
*/
QVariant minimumValue( int index ) const override;
QVariant minimumValue( int index ) const FINAL;
/**
* Returns the maximum value for an attribute column or an invalid variant in case of error.
@ -1855,7 +1855,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \see minimumValue()
* \see uniqueValues()
*/
QVariant maximumValue( int index ) const override;
QVariant maximumValue( int index ) const FINAL;
/**
* Calculates an aggregated value from the layer's features.
@ -1896,7 +1896,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
double opacity() const;
QString htmlMetadata() const override;
QString htmlMetadata() const FINAL;
/**
* Set the simplification settings for fast rendering of features
@ -1956,9 +1956,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
void setMapTipTemplate( const QString &mapTipTemplate );
QgsExpressionContext createExpressionContext() const override;
QgsExpressionContext createExpressionContext() const FINAL;
QgsExpressionContextScope *createExpressionContextScope() const override SIP_FACTORY;
QgsExpressionContextScope *createExpressionContextScope() const FINAL SIP_FACTORY;
/**
* Returns the configuration of the form used to represent this vector layer.
@ -2326,6 +2326,10 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
void symbolFeatureCountMapChanged();
protected:
//! Sets the extent
void setExtent( const QgsRectangle &rect ) FINAL;
private slots:
void invalidateSymbolCountedFlag();
void onFeatureCounterCompleted();
@ -2336,17 +2340,13 @@ 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 ) override;
private:
void updateDefaultValues( QgsFeatureId fid, QgsFeature feature = QgsFeature() );
/**
* Returns true if the provider is in read-only mode
*/
bool isReadOnly() const override;
bool isReadOnly() const FINAL;
/**
* Bind layer to a specific data provider