Skip to content
Permalink
Browse files

Update API

  • Loading branch information
pblottiere committed May 8, 2020
1 parent 60d87e7 commit 306065e5c47e7f9a3b4d87c12448ed314048f8d3
Showing with 7 additions and 7 deletions.
  1. +5 −2 src/core/qgslegendrenderer.cpp
  2. +1 −1 src/core/qgslegendrenderer.h
  3. +1 −4 src/server/services/wms/qgswmsrenderer.cpp
@@ -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 )
@@ -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.
@@ -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

0 comments on commit 306065e

Please sign in to comment.
You can’t perform that action at this time.