QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgslayertreemodellegendnode.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayertreemodellegendnode.h
3 --------------------------------------
4 Date : August 2014
5 Copyright : (C) 2014 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7
8 QgsWMSLegendNode : Sandro Santilli < strk at keybit dot net >
9
10 ***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSLAYERTREEMODELLEGENDNODE_H
20#define QGSLAYERTREEMODELLEGENDNODE_H
21
22#include "qgis_core.h"
23#include "qgis_sip.h"
25#include "qgslegendpatchshape.h"
26#include "qgspallabeling.h"
27
28#include <QIcon>
29#include <QObject>
30
34class QgsMapSettings;
35class QgsSymbol;
37class QgsTextFormat;
38class QgsTextDocument;
40
49class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
50{
51 //SIP_TYPEHEADER_INCLUDE( "qgscolorramplegendnode.h" );
52
53#ifdef SIP_RUN
55 if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
56 sipType = sipType_QgsSymbolLegendNode;
57 else if ( qobject_cast<QgsDataDefinedSizeLegendNode *> ( sipCpp ) )
58 sipType = sipType_QgsDataDefinedSizeLegendNode;
59 else if ( qobject_cast<QgsImageLegendNode *> ( sipCpp ) )
60 sipType = sipType_QgsImageLegendNode;
61 else if ( qobject_cast<QgsRasterSymbolLegendNode *> ( sipCpp ) )
62 sipType = sipType_QgsRasterSymbolLegendNode;
63 else if ( qobject_cast<QgsSimpleLegendNode *> ( sipCpp ) )
64 sipType = sipType_QgsSimpleLegendNode;
65 else if ( qobject_cast<QgsWmsLegendNode *> ( sipCpp ) )
66 sipType = sipType_QgsWmsLegendNode;
67 else if ( qobject_cast<QgsColorRampLegendNode *> ( sipCpp ) )
68 sipType = sipType_QgsColorRampLegendNode;
69 else
70 sipType = 0;
72#endif
73
74 Q_OBJECT
75
76 public:
77
78 // *INDENT-OFF*
79
87 {
88 RuleKey SIP_MONKEYPATCH_COMPAT_NAME( RuleKeyRole ) = Qt::UserRole,
89 ParentRuleKey SIP_MONKEYPATCH_COMPAT_NAME( ParentRuleKeyRole ),
90 NodeType SIP_MONKEYPATCH_COMPAT_NAME( NodeTypeRole ),
91 IsDataDefinedSize SIP_MONKEYPATCH_COMPAT_NAME( IsDataDefinedSizeRole ),
92 };
93 Q_ENUM( CustomRole )
94 // *INDENT-ON*
95
96
108
111
113 QgsLayerTreeModel *model() const;
114
116 virtual Qt::ItemFlags flags() const;
117
119 virtual QVariant data( int role ) const = 0;
120
122 virtual bool setData( const QVariant &value, int role );
123
124 virtual bool isEmbeddedInParent() const { return mEmbeddedInParent; }
125 virtual void setEmbeddedInParent( bool embedded ) { mEmbeddedInParent = embedded; }
126
127 virtual QString userLabel() const { return mUserLabel; }
128 virtual void setUserLabel( const QString &userLabel ) { mUserLabel = userLabel; }
129
139 virtual QSizeF userPatchSize() const;
140
150 virtual void setUserPatchSize( QSizeF size );
151
158 virtual void setColumnBreak( bool breakBeforeNode ) { mColumnBreakBeforeNode = breakBeforeNode; }
159
166 virtual bool columnBreak() const { return mColumnBreakBeforeNode; }
167
168 virtual bool isScaleOK( double scale ) const { Q_UNUSED( scale ) return true; }
169
174 virtual void invalidateMapBasedData() {}
175
177 {
178 Q_NOWARN_DEPRECATED_PUSH //because of deprecated members
179 ItemContext() = default;
181
185 QPainter *painter = nullptr;
186
191 Q_DECL_DEPRECATED QPointF point;
192
197 Q_DECL_DEPRECATED double labelXOffset = 0.0;
198
203 double top = 0.0;
204
211 double columnLeft = 0.0;
212
219 double columnRight = 0.0;
220
227
234
242 QSizeF patchSize;
243
250
257
264
265 };
266
268 {
270 QSizeF labelSize;
271 };
272
277 virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext &ctx );
278
286 QJsonObject exportToJson( const QgsLegendSettings &settings, const QgsRenderContext &context );
287
295 virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
296
303 virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;
304
312 virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;
313
314#ifdef SIP_RUN
315 SIP_PYOBJECT __repr__();
316 % MethodCode
317 QString str = QStringLiteral( "<QgsLayerTreeModelLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
318 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
319 % End
320#endif
321
322 public slots:
323
330 void checkAllItems();
331
338 void uncheckAllItems();
339
346 void toggleAllItems();
347
348 signals:
351
358
359 protected:
361 explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer *nodeL, QObject *parent SIP_TRANSFERTHIS = nullptr );
362
365
366 protected:
369 QString mUserLabel;
371 QSizeF mUserSize;
373
374 private:
375
380 void checkAll( bool state );
381};
383
384#include "qgslegendsymbolitem.h"
385#include "qgstextformat.h"
386
394{
395 Q_OBJECT
396
397 public:
398
399 static double MINIMUM_SIZE;
400 static double MAXIMUM_SIZE;
401
408 QgsSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItem &item, QObject *parent SIP_TRANSFERTHIS = nullptr );
410
411 Qt::ItemFlags flags() const override;
412 QVariant data( int role ) const override;
413 bool setData( const QVariant &value, int role ) override;
414
415 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
416
417 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
418
419 void setEmbeddedInParent( bool embedded ) override;
420
421 void setUserLabel( const QString &userLabel ) override { mUserLabel = userLabel; updateLabel(); }
422
423 bool isScaleOK( double scale ) const override { return mItem.isScaleOK( scale ); }
424
425 void invalidateMapBasedData() override;
426
430 void setIconSize( QSize sz );
431 QSize iconSize() const { return mIconSize; }
432
439 QSize minimumIconSize() const;
440
446 QSize minimumIconSize( QgsRenderContext *context ) const;
447
452 const QgsSymbol *symbol() const;
453
460 void setSymbol( QgsSymbol *symbol SIP_TRANSFER );
461
466 QString textOnSymbolLabel() const { return mTextOnSymbolLabel; }
467
472 void setTextOnSymbolLabel( const QString &label ) { mTextOnSymbolLabel = label; }
473
478 QgsTextFormat textOnSymbolTextFormat() const { return mTextOnSymbolTextFormat; }
479
484 void setTextOnSymbolTextFormat( const QgsTextFormat &format ) { mTextOnSymbolTextFormat = format; }
485
490 QString symbolLabel() const;
491
498 QgsLegendPatchShape patchShape() const;
499
506 void setPatchShape( const QgsLegendPatchShape &shape );
507
517 QgsSymbol *customSymbol() const;
518
530 void setCustomSymbol( QgsSymbol *symbol SIP_TRANSFER );
531
538 QString evaluateLabel( const QgsExpressionContext &context = QgsExpressionContext(), const QString &label = QString() );
539
547 QgsExpressionContextScope *createSymbolScope() const SIP_FACTORY;
548
549#ifdef SIP_RUN
550 SIP_PYOBJECT __repr__();
551 % MethodCode
552 QString str = QStringLiteral( "<QgsSymbolLegendNode: %1 \"%2\"" ).arg(
553 sipCpp->data( static_cast< int >( QgsLayerTreeModelLegendNode::CustomRole::RuleKey ) ).toString(),
554 sipCpp->data( Qt::DisplayRole ).toString() );
555 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
556 % End
557#endif
558
559 private:
560 void updateLabel();
561
562 private:
564 mutable QPixmap mPixmap; // cached symbol preview
565 QString mLabel;
566 bool mSymbolUsesMapUnits;
567
568 QSize mIconSize;
569
570 QString mTextOnSymbolLabel;
571 QgsTextFormat mTextOnSymbolTextFormat;
572
573 std::unique_ptr< QgsSymbol > mCustomSymbol;
574
575 // ident the symbol icon to make it look like a tree structure
576 static const int INDENT_SIZE = 20;
577
578};
579
580
587{
588 Q_OBJECT
589
590 public:
591
600 QgsSimpleLegendNode( QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon = QIcon(), QObject *parent SIP_TRANSFERTHIS = nullptr, const QString &key = QString() );
601
602 QVariant data( int role ) const override;
603
604#ifdef SIP_RUN
605 SIP_PYOBJECT __repr__();
606 % MethodCode
607 QString str = QStringLiteral( "<QgsSimpleLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
608 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
609 % End
610#endif
611
612 private:
613 QString mLabel;
614 QString mId;
615 QIcon mIcon;
616 QString mKey;
617};
618
619
625{
626 Q_OBJECT
627
628 public:
629
636 QgsImageLegendNode( QgsLayerTreeLayer *nodeLayer, const QImage &img, QObject *parent SIP_TRANSFERTHIS = nullptr );
637
638 QVariant data( int role ) const override;
639
640 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
641
642 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
643
644#ifdef SIP_RUN
645 SIP_PYOBJECT __repr__();
646 % MethodCode
647 QString str = QStringLiteral( "<QgsImageLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
648 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
649 % End
650#endif
651
652 private:
653 QImage mImage;
654};
655
662{
663 Q_OBJECT
664
665 public:
666
677 QgsRasterSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QColor &color, const QString &label, QObject *parent SIP_TRANSFERTHIS = nullptr,
678 bool isCheckable = false, const QString &ruleKey = QString(), const QString &parentRuleKey = QString() );
679
680 Qt::ItemFlags flags() const override;
681 QVariant data( int role ) const override;
682 bool setData( const QVariant &value, int role ) override;
683 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
684 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
685
691 QString ruleKey() const { return mRuleKey; }
692
698 bool isCheckable() const { return mCheckable; }
699
700#ifdef SIP_RUN
701 SIP_PYOBJECT __repr__();
702 % MethodCode
703 QString str = QStringLiteral( "<QgsRasterSymbolLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
704 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
705 % End
706#endif
707
708 private:
709 QColor mColor;
710 QString mLabel;
711 bool mCheckable = false;
712 QString mRuleKey;
713 QString mParentRuleKey;
714};
715
716class QgsImageFetcher;
717
724{
725 Q_OBJECT
726
727 public:
728
734 QgsWmsLegendNode( QgsLayerTreeLayer *nodeLayer, QObject *parent SIP_TRANSFERTHIS = nullptr );
735
737
738 QVariant data( int role ) const override;
739
740 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
741
742 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
743
744 void invalidateMapBasedData() override;
745
750 QImage getLegendGraphicBlocking( ) const;
751
752
753#ifdef SIP_RUN
754 SIP_PYOBJECT __repr__();
755 % MethodCode
756 QString str = QStringLiteral( "<QgsWmsLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
757 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
758 % End
759#endif
760
761 private slots:
762
763 void getLegendGraphicFinished( const QImage & );
764 void getLegendGraphicErrored( const QString & );
765 void getLegendGraphicProgress( qint64, qint64 );
766
767 private:
768
769 // Lazy loading of the image
770 QImage getLegendGraphic( bool synchronous = false ) const;
771
772 QImage renderMessage( const QString &msg ) const;
773
774 QImage mImage;
775
776 bool mValid;
777
778 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
779};
780
781
787{
788 Q_OBJECT
789
790 public:
792 QgsDataDefinedSizeLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent SIP_TRANSFERTHIS = nullptr );
794
795 QVariant data( int role ) const override;
796
797 ItemMetrics draw( const QgsLegendSettings &settings, ItemContext &ctx ) override;
798
799#ifdef SIP_RUN
800 SIP_PYOBJECT __repr__();
801 % MethodCode
802 QString str = QStringLiteral( "<QgsDataDefinedSizeLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
803 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
804 % End
805#endif
806
807 private:
808 void cacheImage() const;
809 std::unique_ptr<QgsDataDefinedSizeLegend> mSettings;
810 mutable QImage mImage;
811};
812
819{
820 Q_OBJECT
821 public:
822
829 QgsVectorLabelLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsPalLayerSettings &labelSettings, QObject *parent = nullptr );
830 ~QgsVectorLabelLegendNode() override;
831
837 QVariant data( int role ) const override;
838
846 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
847
854 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
855
856#ifdef SIP_RUN
857 SIP_PYOBJECT __repr__();
858 % MethodCode
859 QString str = QStringLiteral( "<QgsVectorLabelLegendNode: \"%1\">" ).arg( sipCpp->data( Qt::DisplayRole ).toString() );
860 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
861 % End
862#endif
863
864 private:
865 QgsPalLayerSettings mLabelSettings;
866 QSizeF drawSymbol( const QgsLegendSettings &settings, const QgsRenderContext &renderContext, double xOffset = 0.0, double yOffset = 0.0 ) const;
867 void textWidthHeight( double &width, double &height, QgsRenderContext &ctx, const QgsTextFormat &textFormat, const QStringList &textLines ) const;
868};
869
870
871#endif // QGSLAYERTREEMODELLEGENDNODE_H
QgsDataDefinedSizeLegendNode(QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent=nullptr)
Construct the node using QgsDataDefinedSizeLegend as definition of the node's appearance.
ItemMetrics draw(const QgsLegendSettings &settings, ItemContext &ctx) override
Entry point called from QgsLegendRenderer to do the rendering.
QVariant data(int role) const override
Returns data associated with the item. Must be implemented in derived class.
Object that keeps configuration of appearance of marker symbol's data-defined size in legend.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QVariant data(int role) const override
Returns data associated with the item. Must be implemented in derived class.
QgsImageLegendNode(QgsLayerTreeLayer *nodeLayer, const QImage &img, QObject *parent=nullptr)
Constructor for QgsImageLegendNode.
QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
Draws symbol on the left side of the item.
QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const override
Adds a symbol in base64 string within a JSON object with the key "icon".
Layer tree node points to a map layer.
virtual QVariant data(int role) const =0
Returns data associated with the item. Must be implemented in derived class.
QJsonObject exportToJson(const QgsLegendSettings &settings, const QgsRenderContext &context)
Entry point called from QgsLegendRenderer to do the rendering in a JSON object.
virtual bool columnBreak() const
Returns whether a forced column break should occur before the node.
@ SimpleLegend
Simple label with icon legend node type.
@ RasterSymbolLegend
Raster symbol legend node type.
@ ImageLegend
Raster image legend node type.
@ DataDefinedSizeLegend
Marker symbol legend node type.
@ EmbeddedWidget
Embedded widget placeholder node type.
@ SymbolLegend
Vector symbol legend node type.
void checkAllItems()
Checks all checkable items belonging to the same layer as this node.
void uncheckAllItems()
Unchecks all checkable items belonging to the same layer as this node.
virtual bool isScaleOK(double scale) const
virtual void setColumnBreak(bool breakBeforeNode)
Sets whether a forced column break should occur before the node.
QgsLayerTreeModelLegendNode(QgsLayerTreeLayer *nodeL, QObject *parent=nullptr)
Construct the node with pointer to its parent layer node.
virtual void invalidateMapBasedData()
Notification from model that information from associated map view has changed.
void sizeChanged()
Emitted when the size of this node changes.
virtual ItemMetrics draw(const QgsLegendSettings &settings, ItemContext &ctx)
Entry point called from QgsLegendRenderer to do the rendering.
void dataChanged()
Emitted on internal data change so the layer tree model can forward the signal to views.
QgsRenderContext * createTemporaryRenderContext() const
Returns a temporary context or nullptr if legendMapViewData are not valid.
virtual QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const
Adds a symbol in base64 string within a JSON object with the key "icon".
void toggleAllItems()
Toggle all checkable items belonging to the same layer as this node.
QgsLayerTreeLayer * layerNode() const
Returns pointer to the parent layer node.
virtual QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const
Draws symbol on the left side of the item.
virtual void setEmbeddedInParent(bool embedded)
virtual void setUserLabel(const QString &userLabel)
virtual bool setData(const QVariant &value, int role)
Sets some data associated with the item. Default implementation does nothing and returns false.
virtual QSizeF drawSymbolText(const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize) const
Draws label on the right side of the item.
A model representing the layer tree, including layers and groups of layers.
Represents a patch shape for use in map legends.
Stores the appearance and layout settings for legend drawing with QgsLegendRenderer.
Stores information about one class/rule of a vector layer renderer in a unified way that can be used ...
Contains configuration for rendering maps.
Contains settings for how a map layer will be labeled.
Qt::ItemFlags flags() const override
Returns item flags associated with the item. Default implementation returns Qt::ItemIsEnabled.
bool setData(const QVariant &value, int role) override
Sets some data associated with the item. Default implementation does nothing and returns false.
QString ruleKey() const
Returns the unique identifier of node for identification of the item within renderer.
QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const override
Adds a symbol in base64 string within a JSON object with the key "icon".
QgsRasterSymbolLegendNode(QgsLayerTreeLayer *nodeLayer, const QColor &color, const QString &label, QObject *parent=nullptr, bool isCheckable=false, const QString &ruleKey=QString(), const QString &parentRuleKey=QString())
Constructor for QgsRasterSymbolLegendNode.
QVariant data(int role) const override
Returns data associated with the item. Must be implemented in derived class.
bool isCheckable() const
Returns whether the item is user-checkable - whether renderer supports enabling/disabling it.
QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
Draws symbol on the left side of the item.
Contains information about the context of a rendering operation.
Stores properties relating to a screen.
QVariant data(int role) const override
Returns data associated with the item. Must be implemented in derived class.
QgsSimpleLegendNode(QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon=QIcon(), QObject *parent=nullptr, const QString &key=QString())
Constructor for QgsSimpleLegendNode.
QString textOnSymbolLabel() const
Returns label of text to be shown on top of the symbol.
QgsSymbolLegendNode(QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItem &item, QObject *parent=nullptr)
Constructor for QgsSymbolLegendNode.
void setUserLabel(const QString &userLabel) override
void setTextOnSymbolTextFormat(const QgsTextFormat &format)
Sets format of text to be shown on top of the symbol.
void setTextOnSymbolLabel(const QString &label)
Sets label of text to be shown on top of the symbol.
~QgsSymbolLegendNode() override
QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
Draws symbol on the left side of the item.
bool setData(const QVariant &value, int role) override
Sets some data associated with the item. Default implementation does nothing and returns false.
Qt::ItemFlags flags() const override
Returns item flags associated with the item. Default implementation returns Qt::ItemIsEnabled.
bool isScaleOK(double scale) const override
void setEmbeddedInParent(bool embedded) override
QVariant data(int role) const override
Returns data associated with the item. Must be implemented in derived class.
QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const override
Adds a symbol in base64 string within a JSON object with the key "icon".
QgsTextFormat textOnSymbolTextFormat() const
Returns text format of the label to be shown on top of the symbol.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:231
Contains pre-calculated metrics of a QgsTextDocument.
Represents a document consisting of one or more QgsTextBlock objects.
Container for all settings relating to text rendering.
QgsVectorLabelLegendNode(QgsLayerTreeLayer *nodeLayer, const QgsPalLayerSettings &labelSettings, QObject *parent=nullptr)
QgsVectorLabelLegendNode.
QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
drawSymbol
QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const override
exportSymbolToJson
QVariant data(int role) const override
data Returns data associated with the item
QImage getLegendGraphicBlocking() const
Fetches the image from the server and returns it.
QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
Draws symbol on the left side of the item.
void invalidateMapBasedData() override
Notification from model that information from associated map view has changed.
QVariant data(int role) const override
Returns data associated with the item. Must be implemented in derived class.
~QgsWmsLegendNode() override
QgsWmsLegendNode(QgsLayerTreeLayer *nodeLayer, QObject *parent=nullptr)
Constructor for QgsWmsLegendNode.
QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const override
Adds a symbol in base64 string within a JSON object with the key "icon".
#define Q_NOWARN_DEPRECATED_POP
Definition qgis.h:7170
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:7169
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:199
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition qgis_sip.h:268
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84
#define SIP_END
Definition qgis_sip.h:216
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Definition qgis_sip.h:270
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
Q_NOWARN_DEPRECATED_PUSH ItemContext()=default
Q_DECL_DEPRECATED double labelXOffset
Offset from the left side where label should start.
QgsLegendPatchShape patchShape
The patch shape to render for the node.
QgsScreenProperties screenProperties
Destination screen properties.
double maxSiblingSymbolWidth
Largest symbol width, considering all other sibling legend components associated with the current com...
QSizeF patchSize
Symbol patch size to render for the node.
const QgsTextDocument * textDocument
Optional text document.
double columnLeft
Left side of current legend column.
const QgsTextDocumentMetrics * textDocumentMetrics
Optional text document metrics.
double columnRight
Right side of current legend column.
Q_DECL_DEPRECATED QPointF point
Top-left corner of the legend item.
Q_NOWARN_DEPRECATED_POP QgsRenderContext * context
Render context, if available.