Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update SIP binding
  • Loading branch information
pblottiere committed Mar 19, 2019
1 parent 94fb2e1 commit 7adb114
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Expand Up @@ -94,6 +94,14 @@ 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.
%End

void draw( const QgsLegendSettings &settings, QJsonObject &json );
%Docstring
Entry point called from QgsLegendRenderer to do the rendering in a \a
json object.

.. versionadded:: 3.8
%End

virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
Expand All @@ -105,6 +113,17 @@ Draws symbol on the left side of the item
: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)
%End

virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;
%Docstring
Adds a symbol in base64 string within the ``json`` object with the key
"icon".

:param settings: Legend layout configuration
:param json: The json object to update

.. versionadded:: 3.8
%End

virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;
Expand All @@ -116,6 +135,16 @@ Draws label on the right side of the item
:param symbolSize: Real size of the associated symbol - used for correct positioning when rendering

:return: Size of the label (may span multiple lines)
%End

void drawSymbolText( const QgsLegendSettings &settings, QJsonObject &json ) const;
%Docstring
Adds a label in the ``json`` object with the key "title".

:param settings: Legend layout configuration
:param json: The json object to update

.. versionadded:: 3.8
%End

signals:
Expand Down Expand Up @@ -172,6 +201,9 @@ Constructor for QgsSymbolLegendNode.
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;


virtual void setEmbeddedInParent( bool embedded );


Expand Down Expand Up @@ -358,6 +390,9 @@ Constructor for QgsImageLegendNode.
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;


};

class QgsRasterSymbolLegendNode : QgsLayerTreeModelLegendNode
Expand Down Expand Up @@ -389,6 +424,9 @@ Constructor for QgsRasterSymbolLegendNode.
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;


};


Expand Down Expand Up @@ -419,6 +457,9 @@ Constructor for QgsWmsLegendNode.
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;


virtual void invalidateMapBasedData();


Expand Down
7 changes: 7 additions & 0 deletions python/core/auto_generated/qgslegendrenderer.sip.in
Expand Up @@ -76,6 +76,13 @@ The ``painter`` should be scaled beforehand so that units correspond to millimet
Draws the legend using a given render ``context``. The legend will occupy the area reported in legendSize().

.. versionadded:: 3.6
%End

void drawLegend( QJsonObject &json );
%Docstring
Renders the legend in a ``json`` object.

.. versionadded:: 3.8
%End

static void setNodeLegendStyle( QgsLayerTreeNode *node, QgsLegendStyle::Style style );
Expand Down

0 comments on commit 7adb114

Please sign in to comment.