Misc documentation fixes causing errors in PyQGIS doc builder

This commit is contained in:
Nyall Dawson 2025-04-08 15:33:34 +10:00
parent e5327c3749
commit fc76784e09
18 changed files with 65 additions and 72 deletions

View File

@ -243,8 +243,8 @@ Returns list of data item providers of the provider
Lists stored layer styles in the provider defined by ``providerKey`` and
``uri``
:return: - 1 if not implemented by provider, otherwise number of styles
stored
:return: ``-1`` if not implemented by provider, otherwise number of
styles stored
.. versionadded:: 3.10
%End

View File

@ -33,18 +33,8 @@ A renderer which draws points as a live heatmap.
virtual QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
%Docstring
.. note::
symbolForFeature2 in Python bindings
%End
virtual QgsSymbolList symbols( QgsRenderContext &context ) const;
%Docstring
.. note::
symbol2 in Python bindings
%End
virtual QString dump() const;
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;

View File

@ -59,18 +59,24 @@ Creates a renderer out of an XML, for loading
bool preprocessingEnabled() const;
%Docstring
:return: ``True`` if the geometries are to be preprocessed (merged with
an union) before rendering.
Returns ``True`` if the geometries are to be preprocessed (merged with
an union) before rendering.
.. seealso:: :py:func:`setPreprocessingEnabled`
%End
void setPreprocessingEnabled( bool enabled );
%Docstring
:param enabled: enables or disables the preprocessing. When enabled,
geometries will be merged with an union before being
rendered. It allows fixing some rendering artifacts
(when rendering overlapping polygons for instance). This
will involve some CPU-demanding computations and is thus
disabled by default.
Sets whether geometries preprocessing is enabled.
When enabled, geometries will be merged with an union before being
rendered.
This allows fixing some rendering artifacts (when rendering overlapping
polygons for instance). This will involve some CPU-demanding
computations and is thus disabled by default.
.. seealso:: :py:func:`preprocessingEnabled`
%End
static QgsInvertedPolygonRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/;

View File

@ -736,18 +736,12 @@ common base class properties in the DOM ``element``.
static void convertSymbolSizeScale( QgsSymbol *symbol, Qgis::ScaleMethod method, const QString &field );
%Docstring
.. note::
this function is used to convert old sizeScale expressions to symbol
level DataDefined size
Converts old sizeScale expressions to symbol level data defined sizes.
%End
static void convertSymbolRotation( QgsSymbol *symbol, const QString &field );
%Docstring
.. note::
this function is used to convert old rotations expressions to symbol
level DataDefined angle
Converts old rotation expressions to symbol level data defined angles.
%End

View File

@ -1414,12 +1414,16 @@ Adds a new part polygon to a multipart feature
Qgis::GeometryOperationResult addPart( QgsCurve *ring /Transfer/ ) /PyName=addCurvedPart/;
%Docstring
Adds a new ring to a multipart feature.
.. note::
Calls to :py:func:`~QgsVectorLayer.addPart` are only valid for layers in which edits have been enabled
by a call to :py:func:`~QgsVectorLayer.startEditing`. Changes made to features using this method are not committed
to the underlying data provider until a :py:func:`~QgsVectorLayer.commitChanges` call is made. Any uncommitted
changes can be discarded by calling :py:func:`~QgsVectorLayer.rollBack`.
%End
int translateFeature( QgsFeatureId featureId, double dx, double dy );

View File

@ -33,8 +33,7 @@ Default constructor
QgsHttpHeaders httpHeaders() const;
%Docstring
:return: build a new ``:py:class:`QgsHttpHeaders``` according to data in
the UI
Returns the headers as defined in the widget.
%End
void setHeaders( const QgsHttpHeaders &headers );

View File

@ -243,8 +243,8 @@ Returns list of data item providers of the provider
Lists stored layer styles in the provider defined by ``providerKey`` and
``uri``
:return: - 1 if not implemented by provider, otherwise number of styles
stored
:return: ``-1`` if not implemented by provider, otherwise number of
styles stored
.. versionadded:: 3.10
%End

View File

@ -33,18 +33,8 @@ A renderer which draws points as a live heatmap.
virtual QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const;
%Docstring
.. note::
symbolForFeature2 in Python bindings
%End
virtual QgsSymbolList symbols( QgsRenderContext &context ) const;
%Docstring
.. note::
symbol2 in Python bindings
%End
virtual QString dump() const;
virtual QSet<QString> usedAttributes( const QgsRenderContext &context ) const;

View File

@ -59,18 +59,24 @@ Creates a renderer out of an XML, for loading
bool preprocessingEnabled() const;
%Docstring
:return: ``True`` if the geometries are to be preprocessed (merged with
an union) before rendering.
Returns ``True`` if the geometries are to be preprocessed (merged with
an union) before rendering.
.. seealso:: :py:func:`setPreprocessingEnabled`
%End
void setPreprocessingEnabled( bool enabled );
%Docstring
:param enabled: enables or disables the preprocessing. When enabled,
geometries will be merged with an union before being
rendered. It allows fixing some rendering artifacts
(when rendering overlapping polygons for instance). This
will involve some CPU-demanding computations and is thus
disabled by default.
Sets whether geometries preprocessing is enabled.
When enabled, geometries will be merged with an union before being
rendered.
This allows fixing some rendering artifacts (when rendering overlapping
polygons for instance). This will involve some CPU-demanding
computations and is thus disabled by default.
.. seealso:: :py:func:`preprocessingEnabled`
%End
static QgsInvertedPolygonRenderer *convertFromRenderer( const QgsFeatureRenderer *renderer ) /Factory/;

View File

@ -736,18 +736,12 @@ common base class properties in the DOM ``element``.
static void convertSymbolSizeScale( QgsSymbol *symbol, Qgis::ScaleMethod method, const QString &field );
%Docstring
.. note::
this function is used to convert old sizeScale expressions to symbol
level DataDefined size
Converts old sizeScale expressions to symbol level data defined sizes.
%End
static void convertSymbolRotation( QgsSymbol *symbol, const QString &field );
%Docstring
.. note::
this function is used to convert old rotations expressions to symbol
level DataDefined angle
Converts old rotation expressions to symbol level data defined angles.
%End

View File

@ -1414,12 +1414,16 @@ Adds a new part polygon to a multipart feature
Qgis::GeometryOperationResult addPart( QgsCurve *ring /Transfer/ ) /PyName=addCurvedPart/;
%Docstring
Adds a new ring to a multipart feature.
.. note::
Calls to :py:func:`~QgsVectorLayer.addPart` are only valid for layers in which edits have been enabled
by a call to :py:func:`~QgsVectorLayer.startEditing`. Changes made to features using this method are not committed
to the underlying data provider until a :py:func:`~QgsVectorLayer.commitChanges` call is made. Any uncommitted
changes can be discarded by calling :py:func:`~QgsVectorLayer.rollBack`.
%End
int translateFeature( QgsFeatureId featureId, double dx, double dy );

View File

@ -33,8 +33,7 @@ Default constructor
QgsHttpHeaders httpHeaders() const;
%Docstring
:return: build a new ``:py:class:`QgsHttpHeaders``` according to data in
the UI
Returns the headers as defined in the widget.
%End
void setHeaders( const QgsHttpHeaders &headers );

View File

@ -248,7 +248,7 @@ class CORE_EXPORT QgsProviderRegistry
/**
* Lists stored layer styles in the provider defined by \a providerKey and \a uri
* \returns -1 if not implemented by provider, otherwise number of styles stored
* \returns ``-1`` if not implemented by provider, otherwise number of styles stored
* \since QGIS 3.10
*/
int listStyles( const QString &providerKey,

View File

@ -48,9 +48,7 @@ class CORE_EXPORT QgsHeatmapRenderer : public QgsFeatureRenderer
void startRender( QgsRenderContext &context, const QgsFields &fields ) override;
bool renderFeature( const QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false ) override SIP_THROW( QgsCsException );
void stopRender( QgsRenderContext &context ) override;
//! \note symbolForFeature2 in Python bindings
QgsSymbol *symbolForFeature( const QgsFeature &feature, QgsRenderContext &context ) const override;
//! \note symbol2 in Python bindings
QgsSymbolList symbols( QgsRenderContext &context ) const override;
QString dump() const override;
QSet<QString> usedAttributes( const QgsRenderContext &context ) const override;

View File

@ -64,14 +64,22 @@ class CORE_EXPORT QgsInvertedPolygonRenderer : public QgsMergedFeatureRenderer
QDomElement save( QDomDocument &doc, const QgsReadWriteContext &context ) override;
//! \returns TRUE if the geometries are to be preprocessed (merged with an union) before rendering.
/**
* Returns TRUE if the geometries are to be preprocessed (merged with an union) before rendering.
*
* \see setPreprocessingEnabled()
*/
bool preprocessingEnabled() const { return mOperation == MergeAndInvert; }
/**
* \param enabled enables or disables the preprocessing.
* Sets whether geometries preprocessing is enabled.
*
* When enabled, geometries will be merged with an union before being rendered.
* It allows fixing some rendering artifacts (when rendering overlapping polygons for instance).
*
* This allows fixing some rendering artifacts (when rendering overlapping polygons for instance).
* This will involve some CPU-demanding computations and is thus disabled by default.
*
* \see preprocessingEnabled()
*/
void setPreprocessingEnabled( bool enabled ) { mOperation = enabled ? MergeAndInvert : InvertOnly; }

View File

@ -713,14 +713,12 @@ class CORE_EXPORT QgsFeatureRenderer
double mReferenceScale = -1.0;
/**
* \note this function is used to convert old sizeScale expressions to symbol
* level DataDefined size
* Converts old sizeScale expressions to symbol level data defined sizes.
*/
static void convertSymbolSizeScale( QgsSymbol *symbol, Qgis::ScaleMethod method, const QString &field );
/**
* \note this function is used to convert old rotations expressions to symbol
* level DataDefined angle
* Converts old rotation expressions to symbol level data defined angles.
*/
static void convertSymbolRotation( QgsSymbol *symbol, const QString &field );

View File

@ -1405,11 +1405,14 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
Q_INVOKABLE Qgis::GeometryOperationResult addPart( const QgsPointSequence &ring ) SIP_PYNAME( addPartV2 );
/**
* \note available in Python as addCurvedPart
* Adds a new ring to a multipart feature.
*
* \note Calls to addPart() are only valid for layers in which edits have been enabled
* by a call to startEditing(). Changes made to features using this method are not committed
* to the underlying data provider until a commitChanges() call is made. Any uncommitted
* changes can be discarded by calling rollBack().
*
* \note available in Python as addCurvedPart
*/
Q_INVOKABLE Qgis::GeometryOperationResult addPart( QgsCurve *ring SIP_TRANSFER ) SIP_PYNAME( addCurvedPart );

View File

@ -46,7 +46,7 @@ class GUI_EXPORT QgsHttpHeaderWidget : public QWidget, private Ui::QgsHttpHeader
~QgsHttpHeaderWidget();
/**
* \return build a new \a QgsHttpHeaders according to data in the UI
* Returns the headers as defined in the widget.
*/
QgsHttpHeaders httpHeaders() const;