Skip to content

Commit

Permalink
Add NULLPTR macro for use in doxygen comments
Browse files Browse the repository at this point in the history
For the c++ api dox this expands to "\c nullptr" (the
\c directive indicates a code literal value), and for sipify/Python
it expands to ``None`` (`` is sphinx annotation for literal values)

Makes for nicer dox for both c++ and Python!
  • Loading branch information
nyalldawson committed Feb 26, 2019
1 parent a7ca087 commit 107b48a
Show file tree
Hide file tree
Showing 297 changed files with 574 additions and 573 deletions.
2 changes: 1 addition & 1 deletion cmake_templates/Doxyfile.in
Expand Up @@ -898,7 +898,7 @@ IMAGE_PATH =
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.

INPUT_FILTER = "sed -e 's/TRUE/\\c true/' -e 's/FALSE/\\c false/'"
INPUT_FILTER = "sed -e 's/TRUE/\\c true/' -e 's/FALSE/\\c false/'" -e 's/NULLPTR/\\c nullptr/'"

# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the
Expand Down
6 changes: 3 additions & 3 deletions python/3d/auto_generated/qgsrulebased3drenderer.sip.in
Expand Up @@ -75,7 +75,7 @@ Similar to rule-based 2D renderer and rule-based labeling, it allows specificati
public:
Rule( QgsAbstract3DSymbol *symbol /Transfer/, const QString &filterExp = QString(), const QString &description = QString(), bool elseRule = false );
%Docstring
takes ownership of symbol, symbol may be None
takes ownership of symbol, symbol may be ``None``
%End
~Rule();

Expand All @@ -89,7 +89,7 @@ takes ownership of symbol, symbol may be None

QgsAbstract3DSymbol *symbol() const;
%Docstring
Returns the labeling settings. May return None.
Returns the labeling settings. May return ``None``.
%End

QString filterExpression() const;
Expand Down Expand Up @@ -127,7 +127,7 @@ Unique rule identifier (for identification of rule within labeling, used as prov

void setSymbol( QgsAbstract3DSymbol *symbol /Transfer/ );
%Docstring
Sets new symbol (or None). Deletes old symbol if any.
Sets new symbol (or ``None``). Deletes old symbol if any.
%End

void setFilterExpression( const QString &filterExp );
Expand Down
4 changes: 2 additions & 2 deletions python/analysis/auto_generated/raster/qgsalignraster.sip.in
Expand Up @@ -137,11 +137,11 @@ Method to be overridden for progress reporting.

void setProgressHandler( ProgressHandler *progressHandler );
%Docstring
Assign a progress handler instance. Does not take ownership. None can be passed.
Assign a progress handler instance. Does not take ownership. ``None`` can be passed.
%End
ProgressHandler *progressHandler() const;
%Docstring
Gets associated progress handler. May be None (default)
Gets associated progress handler. May be ``None`` (default)
%End

void setRasters( const List &list );
Expand Down
Expand Up @@ -60,7 +60,7 @@ Implementations will remove the feature from the layer or from the data provider
QgsVectorLayer *layer() const;
%Docstring
Gets a pointer to the underlying layer.
May return a ``None`` if the layer has been deleted.
May return a ````None```` if the layer has been deleted.
This must only be called from the main thread.
%End

Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/3d/qgs3drendererregistry.sip.in
Expand Up @@ -33,7 +33,7 @@ Returns unique identifier of the 3D renderer class

virtual QgsAbstract3DRenderer *createRenderer( QDomElement &elem, const QgsReadWriteContext &context ) = 0 /Factory/;
%Docstring
Returns new instance of the renderer given the DOM element. Returns None on error.
Returns new instance of the renderer given the DOM element. Returns ``None`` on error.
Pure virtual function: must be implemented in derived classes.
%End

Expand Down
Expand Up @@ -68,7 +68,7 @@ Create a paint effect of this class given an encoded map of properties.

virtual QgsPaintEffectWidget *createWidget() /Factory/;
%Docstring
Create configuration widget for paint effect of this class. Can return None
Create configuration widget for paint effect of this class. Can return ``None``
if there's no GUI for the paint effect class.

:return: configuration widget
Expand Down Expand Up @@ -107,7 +107,7 @@ Returns the metadata for a specific effect.

:param name: unique string name for paint effect class

:return: paint effect metadata if found, otherwise None
:return: paint effect metadata if found, otherwise ``None``
%End

bool addEffectType( QgsPaintEffectAbstractMetadata *metadata /Transfer/ );
Expand All @@ -126,7 +126,7 @@ Creates a new paint effect given the effect name and properties map.
:param name: unique name representing paint effect class
:param properties: encoded string map of effect properties

:return: new paint effect of specified class, or None if matching
:return: new paint effect of specified class, or ``None`` if matching
paint effect could not be created
%End

Expand All @@ -137,7 +137,7 @@ properties.

:param element: encoded DOM element of effect properties

:return: new paint effect, or None if matching
:return: new paint effect, or ``None`` if matching
paint effect could not be created
%End

Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/expression/qgsexpression.sip.in
Expand Up @@ -294,14 +294,14 @@ Returns calculator used for distance and area calculations
%Docstring
Sets the geometry calculator used for distance and area calculations in expressions.
(used by $length, $area and $perimeter functions only).
If the geometry calculator is set to None (default), prepare() will read variables
If the geometry calculator is set to ``None`` (default), prepare() will read variables
from the expression context ("project_ellipsoid", "_project_transform_context" and
"_layer_crs") to build a geometry calculator.
If these variables does not exist and if setGeomCalculator() is not called,
all distance and area calculations are performed using simple
Cartesian methods (ie no ellipsoidal calculations).

:param calc: geometry calculator. Ownership is not transferred. Set to a None to force
:param calc: geometry calculator. Ownership is not transferred. Set to ``None`` to force
Cartesian calculations.

.. seealso:: :py:func:`geomCalculator`
Expand Down
Expand Up @@ -245,7 +245,7 @@ with the variables specified.
Creates a new scope which contains variables and functions relating to a :py:class:`QgsLayoutAtlas`.
For instance, current page name and number.

:param atlas: source atlas. If None, a set of default atlas variables will be added to the scope.
:param atlas: source atlas. If ``None``, a set of default atlas variables will be added to the scope.
%End

static QgsExpressionContextScope *layoutItemScope( const QgsLayoutItem *item ) /Factory/;
Expand Down
Expand Up @@ -465,7 +465,7 @@ E.g. :py:class:`QgsLineString` -> :py:class:`QgsCompoundCurve`, :py:class:`QgsPo
Makes a new geometry with all the points or vertices snapped to the closest point of the grid.
Ownership is transferred to the caller.

If the gridified geometry could not be calculated a None will be returned.
If the gridified geometry could not be calculated ``None`` will be returned.
It may generate an invalid geometry (in some corner cases).
It can also be thought as rounding the edges and it may be useful for removing errors.
Example:
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgscurve.sip.in
Expand Up @@ -203,7 +203,7 @@ Returns an interpolated point on the curve at the specified ``distance``.
If z or m values are present, the output z and m will be interpolated using
the existing vertices' z or m values.

If distance is negative, or is greater than the length of the curve, a None
If distance is negative, or is greater than the length of the curve, ``None``
will be returned.

.. versionadded:: 3.4
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/geometry/qgsgeometry.sip.in
Expand Up @@ -1448,7 +1448,7 @@ Try to convert the geometry to the requested type
:param destType: the geometry type to be converted to
:param destMultipart: determines if the output geometry will be multipart or not

:return: the converted geometry or None if the conversion fails.
:return: the converted geometry or ``None`` if the conversion fails.

.. versionadded:: 2.2
%End
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/geometry/qgsgeometryengine.sip.in
Expand Up @@ -104,15 +104,15 @@ Calculate the symmetric difference of this and ``geom``.
virtual QgsPoint *centroid( QString *errorMsg = 0 ) const = 0 /Factory/;
%Docstring
Calculates the centroid of this.
May return a `None`.
May return a ```None```.

.. versionadded:: 3.0
%End

virtual QgsPoint *pointOnSurface( QString *errorMsg = 0 ) const = 0 /Factory/;
%Docstring
Calculate a point that is guaranteed to be on the surface of this.
May return a `None`.
May return a ```None```.

.. versionadded:: 3.0
%End
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/layertree/qgslayertreegroup.sip.in
Expand Up @@ -136,13 +136,13 @@ Find all group layer nodes

static QgsLayerTreeGroup *readXml( QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or None on error).
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or ``None`` on error).
Does not resolve textual references to layers. Call resolveReferences() afterwards to do it.
%End

static QgsLayerTreeGroup *readXml( QDomElement &element, const QgsProject *project, const QgsReadWriteContext &context ) /Factory/;
%Docstring
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or None on error).
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or ``None`` on error).
Also resolves textual references to layers from the project (calls resolveReferences() internally).

.. versionadded:: 3.0
Expand Down
4 changes: 2 additions & 2 deletions python/core/auto_generated/layertree/qgslayertreelayer.sip.in
Expand Up @@ -51,9 +51,9 @@ Returns the map layer associated with this node.

.. warning::

This can be (and often is!) a None, e.g. in the case of a layer node representing a layer
This can be (and often is!) ``None``, e.g. in the case of a layer node representing a layer
which has not yet been fully loaded into a project, or a layer node representing a layer
with an invalid data source. The returned pointer must ALWAYS be checked to avoid dereferencing a None.
with an invalid data source. The returned pointer must ALWAYS be checked to avoid dereferencing ``None``.

.. seealso:: :py:func:`layerId`
%End
Expand Down
16 changes: 8 additions & 8 deletions python/core/auto_generated/layertree/qgslayertreemodel.sip.in
Expand Up @@ -41,7 +41,7 @@ whether to allow changes to the layer tree.

explicit QgsLayerTreeModel( QgsLayerTree *rootNode, QObject *parent /TransferThis/ = 0 );
%Docstring
Construct a new tree model with given layer tree (root node must not be None).
Construct a new tree model with given layer tree (root node must not be ``None``).
The root node is not transferred by the model.
%End

Expand Down Expand Up @@ -112,7 +112,7 @@ Check whether a flag is enabled
QgsLayerTreeNode *index2node( const QModelIndex &index ) const;
%Docstring
Returns layer tree node for given index. Returns root node for invalid index.
Returns None if index does not refer to a layer tree node (e.g. it is a legend node)
Returns ``None`` if index does not refer to a layer tree node (e.g. it is a legend node)
%End
QModelIndex node2index( QgsLayerTreeNode *node ) const;
%Docstring
Expand All @@ -128,7 +128,7 @@ If ``skipInternal`` is ``True``, a node is included in the output list only if n

static QgsLayerTreeModelLegendNode *index2legendNode( const QModelIndex &index );
%Docstring
Returns legend node for given index. Returns None for invalid index
Returns legend node for given index. Returns ``None`` for invalid index

.. versionadded:: 2.6
%End
Expand Down Expand Up @@ -186,7 +186,7 @@ and rule key.

QgsLayerTree *rootGroup() const;
%Docstring
Returns pointer to the root node of the layer tree. Always a non None value.
Returns pointer to the root node of the layer tree. Always a non ``None`` value.
%End

void setRootGroup( QgsLayerTree *newRootGroup );
Expand Down Expand Up @@ -254,7 +254,7 @@ A scale <= 0 indicates that no scale filtering is being performed.
void setLegendFilterByMap( const QgsMapSettings *settings );
%Docstring
Force only display of legend nodes which are valid for given map settings.
Setting None or invalid map settings will disable the functionality.
Setting ``None`` or invalid map settings will disable the functionality.
Ownership of map settings pointer does not change, a copy is made.

.. versionadded:: 2.6
Expand All @@ -264,7 +264,7 @@ Ownership of map settings pointer does not change, a copy is made.
%Docstring
Filter display of legend nodes for given map settings

:param settings: Map settings. Setting a None or invalid settings will disable any filter. Ownership is not changed, a copy is made
:param settings: Map settings. Setting ``None`` or invalid settings will disable any filter. Ownership is not changed, a copy is made
:param useExtent: Whether to use the extent of the map settings as a first spatial filter on legend nodes
:param polygon: If not empty, this polygon will be used instead of the map extent to filter legend nodes
:param useExpressions: Whether to use legend node filter expressions
Expand All @@ -274,7 +274,7 @@ Filter display of legend nodes for given map settings

const QgsMapSettings *legendFilterMapSettings() const;
%Docstring
Returns the current map settings used for the current legend filter (or None if none is enabled)
Returns the current map settings used for the current legend filter (or ``None`` if none is enabled)

.. versionadded:: 2.14
%End
Expand All @@ -289,7 +289,7 @@ so that legend nodes that use map units can be scaled currectly

void legendMapViewData( double *mapUnitsPerPixel /Out/, int *dpi /Out/, double *scale /Out/ ) const;
%Docstring
Gets hints about map view - to be used in legend nodes. Arguments that are not None will receive values.
Gets hints about map view - to be used in legend nodes. Arguments that are not ``None`` will receive values.
If there are no valid map view data (from previous call to setLegendMapViewData()), returned values are zeros.

.. versionadded:: 2.6
Expand Down
Expand Up @@ -93,15 +93,15 @@ Default implementation does nothing. *
Entry point called from QgsLegendRenderer to do the rendering.
Default implementation calls drawSymbol() and drawSymbolText() methods.

If ctx is None, this is just first stage when preparing layout - without actual rendering.
If ctx is ``None``, this is just first stage when preparing layout - without actual rendering.
%End

virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
%Docstring
Draws symbol on the left side of the item

:param settings: Legend layout configuration
:param ctx: Context for rendering - may be None if only doing layout without actual rendering
:param ctx: Context for rendering - may be ``None`` if only doing layout without actual rendering
:param itemHeight: Minimal height of the legend item - used for correct positioning when rendering

:return: Real size of the symbol (may be bigger than "normal" symbol size from settings)
Expand All @@ -112,7 +112,7 @@ Draws symbol on the left side of the item
Draws label on the right side of the item

:param settings: Legend layout configuration
:param ctx: Context for rendering - may be nullptrnullptr if only doing layout without actual rendering
:param ctx: Context for rendering - may be ``None`` if only doing layout without actual rendering
:param symbolSize: Real size of the associated symbol - used for correct positioning when rendering

:return: Size of the label (may span multiple lines)
Expand Down
Expand Up @@ -89,7 +89,7 @@ Find out about type of the node. It is usually shorter to use convenience functi
%End
QgsLayerTreeNode *parent();
%Docstring
Gets pointer to the parent. If parent is None, the node is a root node
Gets pointer to the parent. If parent is ``None``, the node is a root node
%End
QList<QgsLayerTreeNode *> children();
%Docstring
Expand Down
Expand Up @@ -143,7 +143,7 @@ section.

virtual QgsLayout *nextBody( bool &ok /Out/ );
%Docstring
Returns the next body layout to export, or a None if
Returns the next body layout to export, or ``None`` if
no body layout is required this iteration.

``ok`` will be set to ``False`` if no bodies remain for this section.
Expand Down
14 changes: 7 additions & 7 deletions python/core/auto_generated/layout/qgslayout.sip.in
Expand Up @@ -78,7 +78,7 @@ Calling this method removes all items and pages from the layout.
QgsProject *project() const;
%Docstring
The project associated with the layout. Used to get access to layers, map themes,
relations and various other bits. It is never None.
relations and various other bits. It is never ``None``.
%End

QgsLayoutModel *itemsModel();
Expand Down Expand Up @@ -177,7 +177,7 @@ which deferred z-order updates.

QgsLayoutItem *itemByUuid( const QString &uuid, bool includeTemplateUuids = false ) const;
%Docstring
Returns the layout item with matching ``uuid`` unique identifier, or a None
Returns the layout item with matching ``uuid`` unique identifier, or ``None``
if a matching item could not be found.

If ``includeTemplateUuids`` is ``True``, then item's template UUID
Expand All @@ -196,7 +196,7 @@ Note that template UUIDs are only available while a layout is being restored fro

QgsLayoutItem *itemByTemplateUuid( const QString &uuid ) const;
%Docstring
Returns the layout item with matching template ``uuid`` unique identifier, or a None
Returns the layout item with matching template ``uuid`` unique identifier, or ``None``
if a matching item could not be found. Unlike itemByUuid(), this method ONLY checks
template UUIDs for a match.

Expand Down Expand Up @@ -224,7 +224,7 @@ item found.

QgsLayoutMultiFrame *multiFrameByUuid( const QString &uuid, bool includeTemplateUuids = false ) const;
%Docstring
Returns the layout multiframe with matching ``uuid`` unique identifier, or a None
Returns the layout multiframe with matching ``uuid`` unique identifier, or ``None``
if a matching multiframe could not be found.

If ``includeTemplateUuids`` is ``True``, then the multiframe's :py:func:`QgsLayoutMultiFrame.templateUuid()`
Expand Down Expand Up @@ -438,7 +438,7 @@ Returns list of keys stored in custom properties for the layout.
%Docstring
Returns the map item which will be used to generate corresponding world files when the
layout is exported. If no map was explicitly set via setReferenceMap(), the largest
map in the layout will be returned (or None if there are no maps in the layout).
map in the layout will be returned (or ``None`` if there are no maps in the layout).

.. seealso:: :py:func:`setReferenceMap`
%End
Expand Down Expand Up @@ -587,7 +587,7 @@ and it's associated objects.
QgsLayoutItemGroup *groupItems( const QList<QgsLayoutItem *> &items );
%Docstring
Creates a new group from a list of layout ``items`` and adds the group to the layout.
If grouping was not possible, a None will be returned.
If grouping was not possible, ``None`` will be returned.

.. seealso:: :py:func:`ungroupItems`
%End
Expand Down Expand Up @@ -637,7 +637,7 @@ Emitted whenever the expression variables stored in the layout have been changed
void selectedItemChanged( QgsLayoutItem *selected );
%Docstring
Emitted whenever the selected item changes.
If None, no item is selected.
If ``None``, no item is selected.
%End

void refreshed();
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/layout/qgslayoutexporter.sip.in
Expand Up @@ -326,7 +326,7 @@ an export.
%Docstring
Georeferences a ``file`` (image of PDF) exported from the layout.

The ``referenceMap`` argument specifies a map item to use for georeferencing. If left as None, the
The ``referenceMap`` argument specifies a map item to use for georeferencing. If left as ``None``, the
default layout QgsLayout.referenceMap() will be used.

The ``exportRegion`` argument can be set to a valid rectangle to indicate that only part of the layout was
Expand Down

0 comments on commit 107b48a

Please sign in to comment.