Skip to content
Permalink
Browse files

Add doc

  • Loading branch information
pblottiere committed Mar 4, 2019
1 parent c98a2ec commit 94fb2e13fdc210fdeada0a576e4cf2e9c14be449
Showing with 31 additions and 0 deletions.
  1. +21 −0 src/core/layertree/qgslayertreemodellegendnode.h
  2. +10 −0 src/core/qgslegendrenderer.h
@@ -110,6 +110,12 @@ class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
*/
virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx );

/**
* Entry point called from QgsLegendRenderer to do the rendering in a \a
* json object.
*
* \since QGIS 3.8
*/
void draw( const QgsLegendSettings &settings, QJsonObject &json );

/**
@@ -121,6 +127,14 @@ class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
*/
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;

/**
* Adds a symbol in base64 string within the \a json object with the key
* "icon".
* \param settings Legend layout configuration
* \param json The json object to update
*
* \since QGIS 3.8
*/
virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;

/**
@@ -132,6 +146,13 @@ class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
*/
virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;

/**
* Adds a label in the \a json object with the key "title".
* \param settings Legend layout configuration
* \param json The json object to update
*
* \since QGIS 3.8
*/
void drawSymbolText( const QgsLegendSettings &settings, QJsonObject &json ) const;

signals:
@@ -93,6 +93,11 @@ class CORE_EXPORT QgsLegendRenderer
*/
void drawLegend( QgsRenderContext &context );

/**
* Renders the legend in a \a json object.
*
* \since QGIS 3.8
*/
void drawLegend( QJsonObject &json );

/**
@@ -235,6 +240,11 @@ class CORE_EXPORT QgsLegendRenderer
*/
QSizeF drawGroupTitle( QgsLayerTreeGroup *nodeGroup, QPainter *painter = nullptr, QPointF point = QPointF() );

/**
* Renders a group item in a \a json object.
*
* \since QGIS 3.8
*/
void drawLegend( QgsLayerTreeGroup *nodeGroup, QJsonObject &json );

/**

0 comments on commit 94fb2e1

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