diff --git a/python/core/qgspropertytransformer.sip b/python/core/qgspropertytransformer.sip index c16b023fe04..1d4cef81a34 100644 --- a/python/core/qgspropertytransformer.sip +++ b/python/core/qgspropertytransformer.sip @@ -261,7 +261,7 @@ class QgsPropertyTransformer \param fieldName will be set to a field name which is used to calculate the input to the property transformer. This will be set to an empty string if an expression is the transformer input. - \returns corresponding property transformer, or nullptr if expression could not + \returns corresponding property transformer, or None if expression could not be parsed to a transformer. %End @@ -323,7 +323,7 @@ class QgsGenericNumericTransformer : QgsPropertyTransformer \param fieldName will be set to a field name which is used to calculate the input to the property transformer. This will be set to an empty string if an expression is the transformer input. - \returns corresponding QgsSizeScaleTransformer, or nullptr if expression could not + \returns corresponding QgsSizeScaleTransformer, or None if expression could not be parsed to a size scale transformer. %End @@ -449,7 +449,7 @@ class QgsSizeScaleTransformer : QgsPropertyTransformer \param fieldName will be set to a field name which is used to calculate the input to the property transformer. This will be set to an empty string if an expression is the transformer input. - \returns corresponding QgsSizeScaleTransformer, or nullptr if expression could not + \returns corresponding QgsSizeScaleTransformer, or None if expression could not be parsed to a size scale transformer. %End diff --git a/python/core/raster/qgsrasterfilewriter.sip b/python/core/raster/qgsrasterfilewriter.sip index a4a63034ec9..412c9f13606 100644 --- a/python/core/raster/qgsrasterfilewriter.sip +++ b/python/core/raster/qgsrasterfilewriter.sip @@ -48,7 +48,7 @@ class QgsRasterFileWriter .. note:: Does not work with tiled mode enabled. - \returns Instance of data provider in editing mode (on success) or null on error. + \returns Instance of data provider in editing mode (on success) or None on error. .. versionadded:: 3.0 %End diff --git a/scripts/sipify.pl b/scripts/sipify.pl index 7870d580159..40acb265abc 100755 --- a/scripts/sipify.pl +++ b/scripts/sipify.pl @@ -14,6 +14,9 @@ sub processDoxygenLine $line =~ s/\\a //g; # replace :: with . (changes c++ style namespace/class directives to Python style) $line =~ s/::/./g; + # replace nullptr with None (nullptr means nothing to Python devs) + $line =~ s/\bnullptr\b/None/g; + if ( $line =~ m/[\\@](ingroup|class)/ ) { return "" } diff --git a/src/core/raster/qgsrasterfilewriter.h b/src/core/raster/qgsrasterfilewriter.h index fa872c5249b..d2d097be574 100644 --- a/src/core/raster/qgsrasterfilewriter.h +++ b/src/core/raster/qgsrasterfilewriter.h @@ -59,7 +59,7 @@ class CORE_EXPORT QgsRasterFileWriter * Returned provider may be used to initialize the raster using writeBlock() calls. * Ownership of the returned provider is passed to the caller. * \note Does not work with tiled mode enabled. - * \returns Instance of data provider in editing mode (on success) or null on error. + * \returns Instance of data provider in editing mode (on success) or nullptr on error. * \since QGIS 3.0 */ QgsRasterDataProvider *createOneBandRaster( Qgis::DataType dataType, diff --git a/tests/scripts/sipifyheader.expected.sip b/tests/scripts/sipifyheader.expected.sip index 8f408b56745..e0882004784 100644 --- a/tests/scripts/sipifyheader.expected.sip +++ b/tests/scripts/sipifyheader.expected.sip @@ -131,6 +131,11 @@ Factory annotation Here's some comment mentioning another class QgsAutoAwesomemater.makeLessAwesome. %End + MyPointer *pointerReturnValue(); +%Docstring + I return a pointer. If something bad happens, I return None. +%End + bool isOKwithErrMesg( QString &ErrMsg /Out/ ); void InOutParam( bool &ok = true /In,Out/ ); diff --git a/tests/scripts/sipifyheader.h b/tests/scripts/sipifyheader.h index 7f2b6e15d1b..b2393d2f944 100644 --- a/tests/scripts/sipifyheader.h +++ b/tests/scripts/sipifyheader.h @@ -163,6 +163,11 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass, private Ui::QgsBas */ void LongDocStringMethodWithBrief(); + /** + * I return a pointer. If something bad happens, I return nullptr. + */ + MyPointer *pointerReturnValue(); + bool isOKwithErrMesg( QString &ErrMsg SIP_OUT ); void InOutParam( bool &ok = true SIP_INOUT );