Skip to content

Commit 7adb114

Browse files
committedMar 19, 2019
Update SIP binding
1 parent 94fb2e1 commit 7adb114

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
 

‎python/core/auto_generated/layertree/qgslayertreemodellegendnode.sip.in

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ Entry point called from QgsLegendRenderer to do the rendering.
9494
Default implementation calls drawSymbol() and drawSymbolText() methods.
9595

9696
If ctx is ``None``, this is just first stage when preparing layout - without actual rendering.
97+
%End
98+
99+
void draw( const QgsLegendSettings &settings, QJsonObject &json );
100+
%Docstring
101+
Entry point called from QgsLegendRenderer to do the rendering in a \a
102+
json object.
103+
104+
.. versionadded:: 3.8
97105
%End
98106

99107
virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
@@ -105,6 +113,17 @@ Draws symbol on the left side of the item
105113
:param itemHeight: Minimal height of the legend item - used for correct positioning when rendering
106114

107115
:return: Real size of the symbol (may be bigger than "normal" symbol size from settings)
116+
%End
117+
118+
virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;
119+
%Docstring
120+
Adds a symbol in base64 string within the ``json`` object with the key
121+
"icon".
122+
123+
:param settings: Legend layout configuration
124+
:param json: The json object to update
125+
126+
.. versionadded:: 3.8
108127
%End
109128

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

118137
:return: Size of the label (may span multiple lines)
138+
%End
139+
140+
void drawSymbolText( const QgsLegendSettings &settings, QJsonObject &json ) const;
141+
%Docstring
142+
Adds a label in the ``json`` object with the key "title".
143+
144+
:param settings: Legend layout configuration
145+
:param json: The json object to update
146+
147+
.. versionadded:: 3.8
119148
%End
120149

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

174203

204+
virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;
205+
206+
175207
virtual void setEmbeddedInParent( bool embedded );
176208

177209

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

360392

393+
virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;
394+
395+
361396
};
362397

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

391426

427+
virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;
428+
429+
392430
};
393431

394432

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

421459

460+
virtual void drawSymbol( const QgsLegendSettings &settings, QJsonObject &json ) const;
461+
462+
422463
virtual void invalidateMapBasedData();
423464

424465

‎python/core/auto_generated/qgslegendrenderer.sip.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ The ``painter`` should be scaled beforehand so that units correspond to millimet
7676
Draws the legend using a given render ``context``. The legend will occupy the area reported in legendSize().
7777

7878
.. versionadded:: 3.6
79+
%End
80+
81+
void drawLegend( QJsonObject &json );
82+
%Docstring
83+
Renders the legend in a ``json`` object.
84+
85+
.. versionadded:: 3.8
7986
%End
8087

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

0 commit comments

Comments
 (0)
Please sign in to comment.