QGIS API Documentation 3.99.0-Master (09f76ad7019)
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#include <QString>
31
32using namespace Qt::StringLiterals;
33
37class QgsMapSettings;
38class QgsSymbol;
40class QgsTextFormat;
41class QgsTextDocument;
43
52class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
53{
54 //SIP_TYPEHEADER_INCLUDE( "qgscolorramplegendnode.h" );
55
56#ifdef SIP_RUN
58 if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
59 sipType = sipType_QgsSymbolLegendNode;
60 else if ( qobject_cast<QgsDataDefinedSizeLegendNode *> ( sipCpp ) )
61 sipType = sipType_QgsDataDefinedSizeLegendNode;
62 else if ( qobject_cast<QgsImageLegendNode *> ( sipCpp ) )
63 sipType = sipType_QgsImageLegendNode;
64 else if ( qobject_cast<QgsRasterSymbolLegendNode *> ( sipCpp ) )
65 sipType = sipType_QgsRasterSymbolLegendNode;
66 else if ( qobject_cast<QgsSimpleLegendNode *> ( sipCpp ) )
67 sipType = sipType_QgsSimpleLegendNode;
68 else if ( qobject_cast<QgsWmsLegendNode *> ( sipCpp ) )
69 sipType = sipType_QgsWmsLegendNode;
70 else if ( qobject_cast<QgsColorRampLegendNode *> ( sipCpp ) )
71 sipType = sipType_QgsColorRampLegendNode;
72 else
73 sipType = 0;
75#endif
76
77 Q_OBJECT
78
79 public:
80
81 // *INDENT-OFF*
82
90 {
91 RuleKey SIP_MONKEYPATCH_COMPAT_NAME( RuleKeyRole ) = Qt::UserRole,
92 ParentRuleKey SIP_MONKEYPATCH_COMPAT_NAME( ParentRuleKeyRole ),
93 NodeType SIP_MONKEYPATCH_COMPAT_NAME( NodeTypeRole ),
94 IsDataDefinedSize SIP_MONKEYPATCH_COMPAT_NAME( IsDataDefinedSizeRole ),
95 };
96 Q_ENUM( CustomRole )
97 // *INDENT-ON*
98
99
111
114
116 QgsLayerTreeModel *model() const;
117
119 virtual Qt::ItemFlags flags() const;
120
122 virtual QVariant data( int role ) const = 0;
123
125 virtual bool setData( const QVariant &value, int role );
126
127 virtual bool isEmbeddedInParent() const { return mEmbeddedInParent; }
128 virtual void setEmbeddedInParent( bool embedded ) { mEmbeddedInParent = embedded; }
129
130 virtual QString userLabel() const { return mUserLabel; }
131 virtual void setUserLabel( const QString &userLabel ) { mUserLabel = userLabel; }
132
142 virtual QSizeF userPatchSize() const;
143
153 virtual void setUserPatchSize( QSizeF size );
154
161 virtual void setColumnBreak( bool breakBeforeNode ) { mColumnBreakBeforeNode = breakBeforeNode; }
162
169 virtual bool columnBreak() const { return mColumnBreakBeforeNode; }
170
171 virtual bool isScaleOK( double scale ) const { Q_UNUSED( scale ) return true; }
172
177 virtual void invalidateMapBasedData() {}
178
180 {
181 Q_NOWARN_DEPRECATED_PUSH //because of deprecated members
182 ItemContext() = default;
184
188 QPainter *painter = nullptr;
189
194 Q_DECL_DEPRECATED QPointF point;
195
200 Q_DECL_DEPRECATED double labelXOffset = 0.0;
201
206 double top = 0.0;
207
214 double columnLeft = 0.0;
215
222 double columnRight = 0.0;
223
230
237
245 QSizeF patchSize;
246
253
260
267
268 };
269
271 {
273 QSizeF labelSize;
274 };
275
280 virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext &ctx );
281
289 QJsonObject exportToJson( const QgsLegendSettings &settings, const QgsRenderContext &context );
290
298 virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
299
306 virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;
307
315 virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;
316
317#ifdef SIP_RUN
318 SIP_PYOBJECT __repr__();
319 % MethodCode
320 QString str = u"<QgsLayerTreeModelLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
321 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
322 % End
323#endif
324
325 public slots:
326
333 void checkAllItems();
334
341 void uncheckAllItems();
342
349 void toggleAllItems();
350
351 signals:
354
361
362 protected:
364 explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer *nodeL, QObject *parent SIP_TRANSFERTHIS = nullptr );
365
368
369 protected:
371 bool mEmbeddedInParent = false;
372 QString mUserLabel;
374 QSizeF mUserSize;
376
377 private:
378
383 void checkAll( bool state );
384};
386
387#include "qgslegendsymbolitem.h"
388#include "qgstextformat.h"
389
397{
398 Q_OBJECT
399
400 public:
401
402 static double MINIMUM_SIZE;
403 static double MAXIMUM_SIZE;
404
411 QgsSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItem &item, QObject *parent SIP_TRANSFERTHIS = nullptr );
413
414 Qt::ItemFlags flags() const override;
415 QVariant data( int role ) const override;
416 bool setData( const QVariant &value, int role ) override;
417
418 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
419
420 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
421
422 void setEmbeddedInParent( bool embedded ) override;
423
424 void setUserLabel( const QString &userLabel ) override { mUserLabel = userLabel; updateLabel(); }
425
426 bool isScaleOK( double scale ) const override { return mItem.isScaleOK( scale ); }
427
428 void invalidateMapBasedData() override;
429
433 void setIconSize( QSize sz );
434 QSize iconSize() const { return mIconSize; }
435
442 QSize minimumIconSize() const;
443
449 QSize minimumIconSize( QgsRenderContext *context ) const;
450
455 const QgsSymbol *symbol() const;
456
463 void setSymbol( QgsSymbol *symbol SIP_TRANSFER );
464
469 QString textOnSymbolLabel() const { return mTextOnSymbolLabel; }
470
475 void setTextOnSymbolLabel( const QString &label ) { mTextOnSymbolLabel = label; }
476
481 QgsTextFormat textOnSymbolTextFormat() const { return mTextOnSymbolTextFormat; }
482
487 void setTextOnSymbolTextFormat( const QgsTextFormat &format ) { mTextOnSymbolTextFormat = format; }
488
493 QString symbolLabel() const;
494
501 QgsLegendPatchShape patchShape() const;
502
509 void setPatchShape( const QgsLegendPatchShape &shape );
510
520 QgsSymbol *customSymbol() const;
521
533 void setCustomSymbol( QgsSymbol *symbol SIP_TRANSFER );
534
541 QString evaluateLabel( const QgsExpressionContext &context = QgsExpressionContext(), const QString &label = QString() );
542
550 QgsExpressionContextScope *createSymbolScope() const SIP_FACTORY;
551
552#ifdef SIP_RUN
553 SIP_PYOBJECT __repr__();
554 % MethodCode
555 QString str = u"<QgsSymbolLegendNode: %1 \"%2\""_s.arg(
556 sipCpp->data( static_cast< int >( QgsLayerTreeModelLegendNode::CustomRole::RuleKey ) ).toString(),
557 sipCpp->data( Qt::DisplayRole ).toString() );
558 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
559 % End
560#endif
561
562 private:
563 void updateLabel();
564
565 private:
567 mutable QPixmap mPixmap; // cached symbol preview
568 QString mLabel;
569 bool mSymbolUsesMapUnits = false;
570
571 QSize mIconSize;
572
573 QString mTextOnSymbolLabel;
574 QgsTextFormat mTextOnSymbolTextFormat;
575
576 std::unique_ptr< QgsSymbol > mCustomSymbol;
577
578 // ident the symbol icon to make it look like a tree structure
579 static const int INDENT_SIZE = 20;
580
581};
582
583
590{
591 Q_OBJECT
592
593 public:
594
603 QgsSimpleLegendNode( QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon = QIcon(), QObject *parent SIP_TRANSFERTHIS = nullptr, const QString &key = QString() );
604
605 QVariant data( int role ) const override;
606
607#ifdef SIP_RUN
608 SIP_PYOBJECT __repr__();
609 % MethodCode
610 QString str = u"<QgsSimpleLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
611 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
612 % End
613#endif
614
615 private:
616 QString mLabel;
617 QString mId;
618 QIcon mIcon;
619 QString mKey;
620};
621
622
628{
629 Q_OBJECT
630
631 public:
632
639 QgsImageLegendNode( QgsLayerTreeLayer *nodeLayer, const QImage &img, QObject *parent SIP_TRANSFERTHIS = nullptr );
640
641 QVariant data( int role ) const override;
642
643 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
644
645 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
646
647#ifdef SIP_RUN
648 SIP_PYOBJECT __repr__();
649 % MethodCode
650 QString str = u"<QgsImageLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
651 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
652 % End
653#endif
654
655 private:
656 QImage mImage;
657};
658
665{
666 Q_OBJECT
667
668 public:
669
680 QgsRasterSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QColor &color, const QString &label, QObject *parent SIP_TRANSFERTHIS = nullptr,
681 bool isCheckable = false, const QString &ruleKey = QString(), const QString &parentRuleKey = QString() );
682
683 Qt::ItemFlags flags() const override;
684 QVariant data( int role ) const override;
685 bool setData( const QVariant &value, int role ) override;
686 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
687 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
688
694 QString ruleKey() const { return mRuleKey; }
695
701 bool isCheckable() const { return mCheckable; }
702
703#ifdef SIP_RUN
704 SIP_PYOBJECT __repr__();
705 % MethodCode
706 QString str = u"<QgsRasterSymbolLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
707 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
708 % End
709#endif
710
711 private:
712 QColor mColor;
713 QString mLabel;
714 bool mCheckable = false;
715 QString mRuleKey;
716 QString mParentRuleKey;
717};
718
719class QgsImageFetcher;
720
727{
728 Q_OBJECT
729
730 public:
731
737 QgsWmsLegendNode( QgsLayerTreeLayer *nodeLayer, QObject *parent SIP_TRANSFERTHIS = nullptr );
738
740
741 QVariant data( int role ) const override;
742
743 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
744
745 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
746
747 void invalidateMapBasedData() override;
748
753 QImage getLegendGraphicBlocking( ) const;
754
755
756#ifdef SIP_RUN
757 SIP_PYOBJECT __repr__();
758 % MethodCode
759 QString str = u"<QgsWmsLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
760 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
761 % End
762#endif
763
764 private slots:
765
766 void getLegendGraphicFinished( const QImage & );
767 void getLegendGraphicErrored( const QString & );
768 void getLegendGraphicProgress( qint64, qint64 );
769
770 private:
771
772 // Lazy loading of the image
773 QImage getLegendGraphic( bool synchronous = false ) const;
774
775 QImage renderMessage( const QString &msg ) const;
776
777 QImage mImage;
778
779 bool mValid = false;
780
781 mutable std::unique_ptr<QgsImageFetcher> mFetcher;
782};
783
784
790{
791 Q_OBJECT
792
793 public:
795 QgsDataDefinedSizeLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent SIP_TRANSFERTHIS = nullptr );
797
798 QVariant data( int role ) const override;
799
800 ItemMetrics draw( const QgsLegendSettings &settings, ItemContext &ctx ) override;
801
802#ifdef SIP_RUN
803 SIP_PYOBJECT __repr__();
804 % MethodCode
805 QString str = u"<QgsDataDefinedSizeLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
806 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
807 % End
808#endif
809
810 private:
811 void cacheImage() const;
812 std::unique_ptr<QgsDataDefinedSizeLegend> mSettings;
813 mutable QImage mImage;
814};
815
822{
823 Q_OBJECT
824 public:
825
832 QgsVectorLabelLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsPalLayerSettings &labelSettings, QObject *parent = nullptr );
833 ~QgsVectorLabelLegendNode() override;
834
840 QVariant data( int role ) const override;
841
849 QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
850
857 QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
858
859#ifdef SIP_RUN
860 SIP_PYOBJECT __repr__();
861 % MethodCode
862 QString str = u"<QgsVectorLabelLegendNode: \"%1\">"_s.arg( sipCpp->data( Qt::DisplayRole ).toString() );
863 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
864 % End
865#endif
866
867 private:
868 QgsPalLayerSettings mLabelSettings;
869 QSizeF drawSymbol( const QgsLegendSettings &settings, const QgsRenderContext &renderContext, double xOffset = 0.0, double yOffset = 0.0 ) const;
870 void textWidthHeight( double &width, double &height, QgsRenderContext &ctx, const QgsTextFormat &textFormat, const QStringList &textLines ) const;
871};
872
873
874#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:7486
#define Q_NOWARN_DEPRECATED_PUSH
Definition qgis.h:7485
#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.