Skip to content

Commit

Permalink
Update API
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed May 13, 2020
1 parent 60d87e7 commit 306065e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/core/qgslegendrenderer.cpp
Expand Up @@ -68,14 +68,17 @@ void QgsLegendRenderer::drawLegend( QPainter *painter )
paintAndDetermineSize( context );
}

void QgsLegendRenderer::exportLegendToJson( const QgsRenderContext &context, QJsonObject &json )
QJsonObject QgsLegendRenderer::exportLegendToJson( const QgsRenderContext &context )
{
QJsonObject json;

QgsLayerTreeGroup *rootGroup = mLegendModel->rootGroup();
if ( !rootGroup )
return;
return json;

json[QStringLiteral( "title" )] = mSettings.title();
exportLegendToJson( context, rootGroup, json );
return json;
}

void QgsLegendRenderer::exportLegendToJson( const QgsRenderContext &context, QgsLayerTreeGroup *nodeGroup, QJsonObject &json )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgslegendrenderer.h
Expand Up @@ -100,7 +100,7 @@ class CORE_EXPORT QgsLegendRenderer
*
* \since QGIS 3.8
*/
void exportLegendToJson( const QgsRenderContext &context, QJsonObject &json );
QJsonObject exportLegendToJson( const QgsRenderContext &context );

/**
* Sets the \a style of a \a node.
Expand Down
5 changes: 1 addition & 4 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -194,11 +194,8 @@ namespace QgsWms
QgsLegendRenderer renderer( &model, settings );

// rendering
QJsonObject json;
QgsRenderContext renderContext;
renderer.exportLegendToJson( renderContext, json );

return json;
return renderer.exportLegendToJson( renderContext );
}

void QgsRenderer::runHitTest( const QgsMapSettings &mapSettings, HitTest &hitTest ) const
Expand Down

0 comments on commit 306065e

Please sign in to comment.