Update SIP binding

This commit is contained in:
Blottiere Paul 2019-03-04 15:02:49 +00:00
parent 94fb2e13fd
commit 7adb1145c6
2 changed files with 48 additions and 0 deletions

View File

@ -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;
@ -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;
@ -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:
@ -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 );
@ -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
@ -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;
};
@ -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();

View File

@ -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 );