This commit is contained in:
Nyall Dawson 2019-09-03 09:05:56 +10:00
parent 6de34d472e
commit 4d67f803b4
3 changed files with 7 additions and 8 deletions

View File

@ -261,7 +261,8 @@ Recalculate classes for a layer
:param nclasses: the number of classes
%End
const QgsRendererRangeLabelFormat &labelFormat() const;
QgsRendererRangeLabelFormat labelFormat() const /Deprecated/;
%Docstring
Returns the label format used to generate default classification labels

View File

@ -433,14 +433,12 @@ void QgsGraduatedSymbolRenderer::updateClasses( const QgsVectorLayer *vl, int nc
updateColorRamp( nullptr );
}
const QgsRendererRangeLabelFormat &QgsGraduatedSymbolRenderer::labelFormat() const
Q_NOWARN_DEPRECATED_PUSH
QgsRendererRangeLabelFormat QgsGraduatedSymbolRenderer::labelFormat() const
{
// this is leaking but will be removed in QGIS 4
Q_NOWARN_DEPRECATED_PUSH
QgsRendererRangeLabelFormat *format = new QgsRendererRangeLabelFormat( mClassificationMethod->labelFormat(), mClassificationMethod->labelPrecision(), mClassificationMethod->labelTrimTrailingZeroes() );
Q_NOWARN_DEPRECATED_POP
return *format;
return QgsRendererRangeLabelFormat( mClassificationMethod->labelFormat(), mClassificationMethod->labelPrecision(), mClassificationMethod->labelTrimTrailingZeroes() );
}
Q_NOWARN_DEPRECATED_POP
QgsFeatureRenderer *QgsGraduatedSymbolRenderer::create( QDomElement &element, const QgsReadWriteContext &context )
{

View File

@ -232,7 +232,7 @@ class CORE_EXPORT QgsGraduatedSymbolRenderer : public QgsFeatureRenderer
* \since QGIS 2.6
* \deprecated since QGIS 3.10 use classificationMethod() and QgsClassificationMethod::setLabelFormat instead
*/
Q_DECL_DEPRECATED const QgsRendererRangeLabelFormat &labelFormat() const;
Q_DECL_DEPRECATED QgsRendererRangeLabelFormat labelFormat() const SIP_DEPRECATED;
/**
* Set the label format used to generate default classification labels