File: qgslayertreemodellegendnode.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (816 lines) | stat: -rw-r--r-- 21,984 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/layertree/qgslayertreemodellegendnode.h                     *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/






class QgsLayerTreeModelLegendNode : QObject
{
%Docstring(signature="appended")
The :py:class:`QgsLegendRendererItem` class is abstract interface for
legend items returned from :py:class:`QgsMapLayerLegend` implementation.

The objects are used in :py:class:`QgsLayerTreeModel`. Custom
implementations may offer additional interactivity and customized look.
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
#include "qgscolorramplegendnode.h"
%End
%ConvertToSubClassCode
    if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsSymbolLegendNode;
    else if ( qobject_cast<QgsDataDefinedSizeLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsDataDefinedSizeLegendNode;
    else if ( qobject_cast<QgsImageLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsImageLegendNode;
    else if ( qobject_cast<QgsRasterSymbolLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsRasterSymbolLegendNode;
    else if ( qobject_cast<QgsSimpleLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsSimpleLegendNode;
    else if ( qobject_cast<QgsWmsLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsWmsLegendNode;
    else if ( qobject_cast<QgsColorRampLegendNode *> ( sipCpp ) )
      sipType = sipType_QgsColorRampLegendNode;
    else
      sipType = 0;
%End
  public:


    enum class CustomRole /BaseType=IntEnum/
    {
      RuleKey,
      ParentRuleKey,
      NodeType,
      IsDataDefinedSize,
    };

    enum NodeTypes /BaseType=IntEnum/
    {
      SimpleLegend,
      SymbolLegend,
      RasterSymbolLegend,
      ImageLegend,
      WmsLegend,
      DataDefinedSizeLegend,
      EmbeddedWidget,
      ColorRampLegend,
    };

    QgsLayerTreeLayer *layerNode() const;
%Docstring
Returns pointer to the parent layer node
%End

    QgsLayerTreeModel *model() const;
%Docstring
Returns pointer to model owning this legend node
%End

    virtual Qt::ItemFlags flags() const;
%Docstring
Returns item flags associated with the item. Default implementation
returns Qt.ItemIsEnabled.
%End

    virtual QVariant data( int role ) const = 0;
%Docstring
Returns data associated with the item. Must be implemented in derived
class.
%End

    virtual bool setData( const QVariant &value, int role );
%Docstring
Sets some data associated with the item. Default implementation does
nothing and returns ``False``.
%End

    virtual bool isEmbeddedInParent() const;
    virtual void setEmbeddedInParent( bool embedded );

    virtual QString userLabel() const;
    virtual void setUserLabel( const QString &userLabel );

    virtual QSizeF userPatchSize() const;
%Docstring
Returns the user (overridden) size for the legend node.

If either the width or height are non-zero, they will be used when
rendering the legend node instead of the default symbol width or height
from :py:class:`QgsLegendSettings`.

.. seealso:: :py:func:`setUserPatchSize`

.. versionadded:: 3.14
%End

    virtual void setUserPatchSize( QSizeF size );
%Docstring
Sets the user (overridden) ``size`` for the legend node.

If either the width or height are non-zero, they will be used when
rendering the legend node instead of the default symbol width or height
from :py:class:`QgsLegendSettings`.

.. seealso:: :py:func:`userPatchSize`

.. versionadded:: 3.14
%End

    virtual void setColumnBreak( bool breakBeforeNode );
%Docstring
Sets whether a forced column break should occur before the node.

.. seealso:: :py:func:`columnBreak`

.. versionadded:: 3.14
%End

    virtual bool columnBreak() const;
%Docstring
Returns whether a forced column break should occur before the node.

.. seealso:: :py:func:`setColumnBreak`

.. versionadded:: 3.14
%End

    virtual bool isScaleOK( double scale ) const;

    virtual void invalidateMapBasedData();
%Docstring
Notification from model that information from associated map view has
changed. Default implementation does nothing.
%End

    struct ItemContext
    {
      ItemContext();

      QgsRenderContext *context;
      QPainter *painter;

 QPointF point;

 double labelXOffset;

      double top;

      double columnLeft;

      double columnRight;

      double maxSiblingSymbolWidth;

      QgsLegendPatchShape patchShape;

      QSizeF patchSize;

      const QgsTextDocument *textDocument;

      const QgsTextDocumentMetrics *textDocumentMetrics;

      QgsScreenProperties screenProperties;

    };

    struct ItemMetrics
    {
      QSizeF symbolSize;
      QSizeF labelSize;
    };

    virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx );
%Docstring
Entry point called from :py:class:`QgsLegendRenderer` to do the
rendering. Default implementation calls
:py:func:`~QgsLayerTreeModelLegendNode.drawSymbol` and
:py:func:`~QgsLayerTreeModelLegendNode.drawSymbolText` methods.

If ctx is ``None``, this is just first stage when preparing layout -
without actual rendering.
%End

    QJsonObject exportToJson( const QgsLegendSettings &settings, const QgsRenderContext &context );
%Docstring
Entry point called from :py:class:`QgsLegendRenderer` to do the
rendering in a JSON object.

:param settings: Legend layout configuration
:param context: Rendering context

.. versionadded:: 3.8
%End

    virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
%Docstring
Draws symbol on the left side of the item

:param settings: Legend layout configuration
:param ctx: Context for rendering - may be ``None`` if only doing layout
            without actual rendering
: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 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;
%Docstring
Adds a symbol in base64 string within a JSON object with the key "icon".

:param settings: Legend layout configuration
:param context: Rendering context

.. versionadded:: 3.8
%End

    virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;
%Docstring
Draws label on the right side of the item

:param settings: Legend layout configuration
:param ctx: Context for rendering - may be ``None`` if only doing layout
            without actual rendering
:param symbolSize: Real size of the associated symbol - used for correct
                   positioning when rendering

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

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsLayerTreeModelLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

  public slots:

    void checkAllItems();
%Docstring
Checks all checkable items belonging to the same layer as this node.

.. seealso:: :py:func:`uncheckAllItems`

.. seealso:: :py:func:`toggleAllItems`

.. versionadded:: 3.18
%End

    void uncheckAllItems();
%Docstring
Unchecks all checkable items belonging to the same layer as this node.

.. seealso:: :py:func:`checkAllItems`

.. seealso:: :py:func:`toggleAllItems`

.. versionadded:: 3.18
%End

    void toggleAllItems();
%Docstring
Toggle all checkable items belonging to the same layer as this node.

.. seealso:: :py:func:`checkAllItems`

.. seealso:: :py:func:`uncheckAllItems`

.. versionadded:: 3.18
%End

  signals:
    void dataChanged();
%Docstring
Emitted on internal data change so the layer tree model can forward the
signal to views
%End

    void sizeChanged();
%Docstring
Emitted when the size of this node changes.

.. versionadded:: 3.16
%End

  protected:
    explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer *nodeL, QObject *parent /TransferThis/ = 0 );
%Docstring
Construct the node with pointer to its parent layer node
%End

    QgsRenderContext *createTemporaryRenderContext() const /Factory/;
%Docstring
Returns a temporary context or ``None`` if legendMapViewData are not
valid
%End

  protected:

};


class QgsSymbolLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Implementation of legend node interface for displaying preview of vector
symbols and their labels and allowing interaction with the symbol /
renderer.
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:

    static double MINIMUM_SIZE;
    static double MAXIMUM_SIZE;

    QgsSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItem &item, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsSymbolLegendNode.

:param nodeLayer: layer node
:param item: the legend symbol item
:param parent: attach a parent QObject to the legend node.
%End
    ~QgsSymbolLegendNode();

    virtual Qt::ItemFlags flags() const;

    virtual QVariant data( int role ) const;

    virtual bool setData( const QVariant &value, int role );


    virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


    virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;


    virtual void setEmbeddedInParent( bool embedded );


    virtual void setUserLabel( const QString &userLabel );

    virtual bool isScaleOK( double scale ) const;

    virtual void invalidateMapBasedData();


    void setIconSize( QSize sz );
%Docstring
Set the icon size
%End
    QSize iconSize() const;

    QSize minimumIconSize() const;
%Docstring
Calculates the minimum icon size to prevent cropping. When evaluating
the size for multiple icons it is more efficient to create a single
render context in advance and use the variant which accepts a
:py:class:`QgsRenderContext` argument.
%End

    QSize minimumIconSize( QgsRenderContext *context ) const;
%Docstring
Calculates the minimum icon size to prevent cropping. When evaluating
the size for multiple icons it is more efficient to create a single
render context in advance and call this method instead of
:py:func:`~QgsSymbolLegendNode.minimumIconSize`.
%End

    const QgsSymbol *symbol() const;
%Docstring
Returns the symbol used by the legend node.

.. seealso:: :py:func:`setSymbol`
%End

    void setSymbol( QgsSymbol *symbol /Transfer/ );
%Docstring
Sets the ``symbol`` to be used by the legend node. The symbol change is
also propagated to the associated vector layer's renderer.

:param symbol: new symbol for node. Ownership is transferred.

.. seealso:: :py:func:`symbol`
%End

    QString textOnSymbolLabel() const;
%Docstring
Returns label of text to be shown on top of the symbol.

.. versionadded:: 3.2
%End

    void setTextOnSymbolLabel( const QString &label );
%Docstring
Sets label of text to be shown on top of the symbol.

.. versionadded:: 3.2
%End

    QgsTextFormat textOnSymbolTextFormat() const;
%Docstring
Returns text format of the label to be shown on top of the symbol.

.. versionadded:: 3.2
%End

    void setTextOnSymbolTextFormat( const QgsTextFormat &format );
%Docstring
Sets format of text to be shown on top of the symbol.

.. versionadded:: 3.2
%End

    QString symbolLabel() const;
%Docstring
Label of the symbol, user defined label will be used, otherwise will
default to the label made by QGIS.

.. versionadded:: 3.10
%End

    QgsLegendPatchShape patchShape() const;
%Docstring
Returns the symbol patch shape to use when rendering the legend node
symbol.

.. seealso:: :py:func:`setPatchShape`

.. versionadded:: 3.14
%End

    void setPatchShape( const QgsLegendPatchShape &shape );
%Docstring
Sets the symbol patch ``shape`` to use when rendering the legend node
symbol.

.. seealso:: :py:func:`patchShape`

.. versionadded:: 3.14
%End

    QgsSymbol *customSymbol() const;
%Docstring
Returns the node's custom symbol.

If a non-``None`` value is returned, then this symbol will be used for
rendering the legend node instead of the default
:py:func:`~QgsSymbolLegendNode.symbol`.

.. seealso:: :py:func:`setCustomSymbol`

.. versionadded:: 3.14
%End

    void setCustomSymbol( QgsSymbol *symbol /Transfer/ );
%Docstring
Sets the node's custom ``symbol``.

If a non-``None`` value is set, then this symbol will be used for
rendering the legend node instead of the default
:py:func:`~QgsSymbolLegendNode.symbol`.

Ownership of ``symbol`` is transferred.

.. seealso:: :py:func:`customSymbol`

.. versionadded:: 3.14
%End

    QString evaluateLabel( const QgsExpressionContext &context = QgsExpressionContext(), const QString &label = QString() );
%Docstring
Evaluates and returns the text label of the current node

:param context: extra :py:class:`QgsExpressionContext` to use for
                evaluating the expression
:param label: text to evaluate instead of the layer layertree string

.. versionadded:: 3.10
%End

    QgsExpressionContextScope *createSymbolScope() const /Factory/;
%Docstring
Create an expression context scope containing symbol related variables.

The caller takes ownership of the returned object.

.. versionadded:: 3.36
%End

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsSymbolLegendNode: %1 \"%2\"" ).arg(
                    sipCpp->data( static_cast< int >( QgsLayerTreeModelLegendNode::CustomRole::RuleKey ) ).toString(),
                    sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};


class QgsSimpleLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Implementation of legend node interface for displaying arbitrary label
with icon.
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:

    QgsSimpleLegendNode( QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon = QIcon(), QObject *parent /TransferThis/ = 0, const QString &key = QString() );
%Docstring
Constructor for QgsSimpleLegendNode.

:param nodeLayer: layer node
:param label: label
:param icon: icon
:param parent: attach a parent QObject to the legend node.
:param key: the rule key
%End

    virtual QVariant data( int role ) const;


    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsSimpleLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};


class QgsImageLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Implementation of legend node interface for displaying arbitrary raster
image
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:

    QgsImageLegendNode( QgsLayerTreeLayer *nodeLayer, const QImage &img, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsImageLegendNode.

:param nodeLayer: layer node
:param img: the image
:param parent: attach a parent QObject to the legend node.
%End

    virtual QVariant data( int role ) const;


    virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


    virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;


    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsImageLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};

class QgsRasterSymbolLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Implementation of legend node interface for displaying raster legend
entries
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:

    QgsRasterSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QColor &color, const QString &label, QObject *parent /TransferThis/ = 0,
                               bool isCheckable = false, const QString &ruleKey = QString(), const QString &parentRuleKey = QString() );
%Docstring
Constructor for QgsRasterSymbolLegendNode.

:param nodeLayer: layer node
:param color: color
:param label: label
:param parent: attach a parent QObject to the legend node.
:param isCheckable: set to ``True`` to enable the checkbox for the node
                    (since QGIS 3.18)
:param ruleKey: optional identifier to allow a unique ID to be assigned
                to the node by a renderer (since QGIS 3.18)
:param parentRuleKey: rule key of parent (since QGIS 3.40)
%End

    virtual Qt::ItemFlags flags() const;

    virtual QVariant data( int role ) const;

    virtual bool setData( const QVariant &value, int role );

    virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;

    virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;


    QString ruleKey() const;
%Docstring
Returns the unique identifier of node for identification of the item
within renderer.

.. versionadded:: 3.18
%End

    bool isCheckable() const;
%Docstring
Returns whether the item is user-checkable - whether renderer supports
enabling/disabling it.

.. versionadded:: 3.18
%End

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsRasterSymbolLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};


class QgsWmsLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Implementation of legend node interface for displaying WMS legend
entries
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:

    QgsWmsLegendNode( QgsLayerTreeLayer *nodeLayer, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsWmsLegendNode.

:param nodeLayer: layer node
:param parent: attach a parent QObject to the legend node.
%End

    ~QgsWmsLegendNode();

    virtual QVariant data( int role ) const;


    virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;


    virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;


    virtual void invalidateMapBasedData();


    QImage getLegendGraphicBlocking( ) const;
%Docstring
Fetches the image from the server and returns it.

.. versionadded:: 3.40
%End


    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsWmsLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};


class QgsDataDefinedSizeLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Produces legend node with a marker symbol
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:
    QgsDataDefinedSizeLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent /TransferThis/ = 0 );
%Docstring
Construct the node using :py:class:`QgsDataDefinedSizeLegend` as
definition of the node's appearance
%End
    ~QgsDataDefinedSizeLegendNode();

    virtual QVariant data( int role ) const;


    virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx );


    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsDataDefinedSizeLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};

class QgsVectorLabelLegendNode : QgsLayerTreeModelLegendNode
{
%Docstring(signature="appended")
Produces legend node for a labeling text symbol

.. versionadded:: 3.20
%End

%TypeHeaderCode
#include "qgslayertreemodellegendnode.h"
%End
  public:

    QgsVectorLabelLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsPalLayerSettings &labelSettings, QObject *parent = 0 );
%Docstring
QgsVectorLabelLegendNode

:param nodeLayer: the parent node
:param labelSettings: setting of the label class
:param parent: the parent object
%End
    ~QgsVectorLabelLegendNode();

    virtual QVariant data( int role ) const;

%Docstring
data Returns data associated with the item

:param role: the data role

:return: variant containing the data for the role
%End

    virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;

%Docstring
drawSymbol

:param settings: the legend settings
:param ctx: context for the item
:param itemHeight: the height of the item

:return: size of the item
%End

    virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;

%Docstring
exportSymbolToJson

:param settings: the legend settings
:param context: the item context

:return: the json object
%End

    SIP_PYOBJECT __repr__();
%MethodCode
    QString str = QStringLiteral( "<QgsVectorLabelLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/layertree/qgslayertreemodellegendnode.h                     *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/