Skip to content

Commit

Permalink
Add missing since annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 10, 2019
1 parent 5c2b394 commit 32126ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions python/core/auto_generated/qgslegendrenderer.sip.in
Expand Up @@ -71,9 +71,11 @@ Draws the legend with given ``painter``. The legend will occupy the area reporte
The ``painter`` should be scaled beforehand so that units correspond to millimeters. The ``painter`` should be scaled beforehand so that units correspond to millimeters.
%End %End


void drawLegend( QgsRenderContext *rendercontext ); void drawLegend( QgsRenderContext &context );
%Docstring %Docstring
Draws the legend using a given :py:class:`QgsRenderContext`. The legend will occupy the area reported in legendSize(). Draws the legend using a given render ``context``. The legend will occupy the area reported in legendSize().

.. versionadded:: 3.6
%End %End


static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style ); static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style );
Expand Down
10 changes: 5 additions & 5 deletions src/core/qgslegendrenderer.cpp
Expand Up @@ -831,12 +831,12 @@ QSizeF QgsLegendRenderer::drawGroupTitle( QgsLayerTreeGroup *nodeGroup, QgsRende
} }




void QgsLegendRenderer::drawLegend( QgsRenderContext *rendercontext ) void QgsLegendRenderer::drawLegend( QgsRenderContext &context )
{ {
paintAndDetermineSize( rendercontext ); paintAndDetermineSize( &context );
} }


QSizeF QgsLegendRenderer::paintAndDetermineSize( QgsRenderContext *rendercontext ) QSizeF QgsLegendRenderer::paintAndDetermineSize( QgsRenderContext *context )
{ {
QSizeF size( 0, 0 ); QSizeF size( 0, 0 );
QgsLayerTreeGroup *rootGroup = mLegendModel->rootGroup(); QgsLayerTreeGroup *rootGroup = mLegendModel->rootGroup();
Expand Down Expand Up @@ -889,7 +889,7 @@ QSizeF QgsLegendRenderer::paintAndDetermineSize( QgsRenderContext *rendercontext
point.ry() += spaceAboveAtom( atom ); point.ry() += spaceAboveAtom( atom );
} }


QSizeF atomSize = drawAtom( atom, rendercontext, point ); QSizeF atomSize = drawAtom( atom, context, point );
columnWidth = std::max( atomSize.width(), columnWidth ); columnWidth = std::max( atomSize.width(), columnWidth );


point.ry() += atom.size.height(); point.ry() += atom.size.height();
Expand Down Expand Up @@ -930,7 +930,7 @@ QSizeF QgsLegendRenderer::paintAndDetermineSize( QgsRenderContext *rendercontext
point.rx() = size.width() - mSettings.boxSpace(); point.rx() = size.width() - mSettings.boxSpace();
} }
point.ry() = mSettings.boxSpace(); point.ry() = mSettings.boxSpace();
drawTitle( rendercontext, point, mSettings.titleAlignment(), size.width() ); drawTitle( context, point, mSettings.titleAlignment(), size.width() );
} }


return size; return size;
Expand Down
6 changes: 4 additions & 2 deletions src/core/qgslegendrenderer.h
Expand Up @@ -86,9 +86,11 @@ class CORE_EXPORT QgsLegendRenderer
void drawLegend( QPainter *painter ); void drawLegend( QPainter *painter );


/** /**
* Draws the legend using a given QgsRenderContext. The legend will occupy the area reported in legendSize(). * Draws the legend using a given render \a context. The legend will occupy the area reported in legendSize().
*
* \since QGIS 3.6
*/ */
void drawLegend( QgsRenderContext *rendercontext ); void drawLegend( QgsRenderContext &context );


/** /**
* Sets the \a style of a \a node. * Sets the \a style of a \a node.
Expand Down

0 comments on commit 32126ca

Please sign in to comment.