QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 <QIcon>
23 #include <QObject>
24 
25 #include "qgis_core.h"
26 #include "qgis_sip.h"
27 
28 #include "qgsexpressioncontext.h"
29 #include "qgslegendpatchshape.h"
30 #include "qgspallabeling.h"
31 
32 class QgsLayerTreeLayer;
33 class QgsLayerTreeModel;
34 class QgsLegendSettings;
35 class QgsMapSettings;
36 class QgsSymbol;
37 class QgsRenderContext;
38 
49 class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
50 {
51 #ifdef SIP_RUN
52 #include "qgscolorramplegendnode.h"
53 #endif
54 
55 #ifdef SIP_RUN
57  if ( qobject_cast<QgsSymbolLegendNode *> ( sipCpp ) )
58  sipType = sipType_QgsSymbolLegendNode;
59  else if ( qobject_cast<QgsDataDefinedSizeLegendNode *> ( sipCpp ) )
60  sipType = sipType_QgsDataDefinedSizeLegendNode;
61  else if ( qobject_cast<QgsImageLegendNode *> ( sipCpp ) )
62  sipType = sipType_QgsImageLegendNode;
63  else if ( qobject_cast<QgsRasterSymbolLegendNode *> ( sipCpp ) )
64  sipType = sipType_QgsRasterSymbolLegendNode;
65  else if ( qobject_cast<QgsSimpleLegendNode *> ( sipCpp ) )
66  sipType = sipType_QgsSimpleLegendNode;
67  else if ( qobject_cast<QgsWmsLegendNode *> ( sipCpp ) )
68  sipType = sipType_QgsWmsLegendNode;
69  else if ( qobject_cast<QgsColorRampLegendNode *> ( sipCpp ) )
70  sipType = sipType_QgsColorRampLegendNode;
71  else
72  sipType = 0;
73  SIP_END
74 #endif
75 
76  Q_OBJECT
77 
78  public:
79 
82  {
83  RuleKeyRole = Qt::UserRole,
86  };
87 
89  enum NodeTypes
90  {
99  };
100 
102  QgsLayerTreeLayer *layerNode() const { return mLayerNode; }
103 
105  QgsLayerTreeModel *model() const;
106 
108  virtual Qt::ItemFlags flags() const;
109 
111  virtual QVariant data( int role ) const = 0;
112 
114  virtual bool setData( const QVariant &value, int role );
115 
116  virtual bool isEmbeddedInParent() const { return mEmbeddedInParent; }
117  virtual void setEmbeddedInParent( bool embedded ) { mEmbeddedInParent = embedded; }
118 
119  virtual QString userLabel() const { return mUserLabel; }
120  virtual void setUserLabel( const QString &userLabel ) { mUserLabel = userLabel; }
121 
131  virtual QSizeF userPatchSize() const;
132 
142  virtual void setUserPatchSize( QSizeF size );
143 
150  virtual void setColumnBreak( bool breakBeforeNode ) { mColumnBreakBeforeNode = breakBeforeNode; }
151 
158  virtual bool columnBreak() const { return mColumnBreakBeforeNode; }
159 
160  virtual bool isScaleOK( double scale ) const { Q_UNUSED( scale ) return true; }
161 
166  virtual void invalidateMapBasedData() {}
167 
168  struct ItemContext
169  {
170  Q_NOWARN_DEPRECATED_PUSH //because of deprecated members
171  ItemContext() = default;
173 
175  QgsRenderContext *context = nullptr;
177  QPainter *painter = nullptr;
178 
183  Q_DECL_DEPRECATED QPointF point;
184 
189  Q_DECL_DEPRECATED double labelXOffset = 0.0;
190 
195  double top = 0.0;
196 
203  double columnLeft = 0.0;
204 
211  double columnRight = 0.0;
212 
218  double maxSiblingSymbolWidth = 0.0;
219 
226 
234  QSizeF patchSize;
235  };
236 
237  struct ItemMetrics
238  {
239  QSizeF symbolSize;
240  QSizeF labelSize;
241  };
242 
249  virtual ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx );
250 
258  QJsonObject exportToJson( const QgsLegendSettings &settings, const QgsRenderContext &context );
259 
267  virtual QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const;
268 
275  virtual QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const;
276 
284  virtual QSizeF drawSymbolText( const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize ) const;
285 
286  public slots:
287 
294  void checkAllItems();
295 
302  void uncheckAllItems();
303 
310  void toggleAllItems();
311 
312  signals:
314  void dataChanged();
315 
321  void sizeChanged();
322 
323  protected:
325  explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer *nodeL, QObject *parent SIP_TRANSFERTHIS = nullptr );
326 
328  QgsRenderContext *createTemporaryRenderContext() const SIP_FACTORY;
329 
330  protected:
331  QgsLayerTreeLayer *mLayerNode = nullptr;
332  bool mEmbeddedInParent;
333  QString mUserLabel;
334  QgsLegendPatchShape mPatchShape;
335  QSizeF mUserSize;
336  bool mColumnBreakBeforeNode = false;
337 
338  private:
339 
344  void checkAll( bool state );
345 };
347 
348 #include "qgslegendsymbolitem.h"
349 #include "qgstextformat.h"
350 
359 {
360  Q_OBJECT
361 
362  public:
363 
364  static double MINIMUM_SIZE;
365  static double MAXIMUM_SIZE;
366 
373  QgsSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsLegendSymbolItem &item, QObject *parent SIP_TRANSFERTHIS = nullptr );
374 
375  Qt::ItemFlags flags() const override;
376  QVariant data( int role ) const override;
377  bool setData( const QVariant &value, int role ) override;
378 
379  QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
380 
381  QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
382 
383  void setEmbeddedInParent( bool embedded ) override;
384 
385  void setUserLabel( const QString &userLabel ) override { mUserLabel = userLabel; updateLabel(); }
386 
387  bool isScaleOK( double scale ) const override { return mItem.isScaleOK( scale ); }
388 
389  void invalidateMapBasedData() override;
390 
395  void setIconSize( QSize sz ) { mIconSize = sz; }
397  QSize iconSize() const { return mIconSize; }
398 
406  QSize minimumIconSize() const;
407 
414  QSize minimumIconSize( QgsRenderContext *context ) const;
415 
421  const QgsSymbol *symbol() const;
422 
430  void setSymbol( QgsSymbol *symbol SIP_TRANSFER );
431 
436  QString textOnSymbolLabel() const { return mTextOnSymbolLabel; }
437 
442  void setTextOnSymbolLabel( const QString &label ) { mTextOnSymbolLabel = label; }
443 
448  QgsTextFormat textOnSymbolTextFormat() const { return mTextOnSymbolTextFormat; }
449 
454  void setTextOnSymbolTextFormat( const QgsTextFormat &format ) { mTextOnSymbolTextFormat = format; }
455 
460  QString symbolLabel() const;
461 
468  QgsLegendPatchShape patchShape() const;
469 
476  void setPatchShape( const QgsLegendPatchShape &shape );
477 
487  QgsSymbol *customSymbol() const;
488 
500  void setCustomSymbol( QgsSymbol *symbol SIP_TRANSFER );
501 
508  QString evaluateLabel( const QgsExpressionContext &context = QgsExpressionContext(), const QString &label = QString() );
509 
510  private:
511  void updateLabel();
512 
513  private:
514  QgsLegendSymbolItem mItem;
515  mutable QPixmap mPixmap; // cached symbol preview
516  QString mLabel;
517  bool mSymbolUsesMapUnits;
518 
519  QSize mIconSize;
520 
521  QString mTextOnSymbolLabel;
522  QgsTextFormat mTextOnSymbolTextFormat;
523 
524  std::unique_ptr< QgsSymbol > mCustomSymbol;
525 
526  // ident the symbol icon to make it look like a tree structure
527  static const int INDENT_SIZE = 20;
528 
533  QgsExpressionContextScope *createSymbolScope() const SIP_FACTORY;
534 
535 };
536 
537 
545 {
546  Q_OBJECT
547 
548  public:
549 
558  QgsSimpleLegendNode( QgsLayerTreeLayer *nodeLayer, const QString &label, const QIcon &icon = QIcon(), QObject *parent SIP_TRANSFERTHIS = nullptr, const QString &key = QString() );
559 
560  QVariant data( int role ) const override;
561 
562  private:
563  QString mLabel;
564  QString mId;
565  QIcon mIcon;
566  QString mKey;
567 };
568 
569 
577 {
578  Q_OBJECT
579 
580  public:
581 
588  QgsImageLegendNode( QgsLayerTreeLayer *nodeLayer, const QImage &img, QObject *parent SIP_TRANSFERTHIS = nullptr );
589 
590  QVariant data( int role ) const override;
591 
592  QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
593 
594  QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
595 
596  private:
597  QImage mImage;
598 };
599 
607 {
608  Q_OBJECT
609 
610  public:
611 
621  QgsRasterSymbolLegendNode( QgsLayerTreeLayer *nodeLayer, const QColor &color, const QString &label, QObject *parent SIP_TRANSFERTHIS = nullptr, bool isCheckable = false, const QString &ruleKey = QString() );
622 
623  Qt::ItemFlags flags() const override;
624  QVariant data( int role ) const override;
625  bool setData( const QVariant &value, int role ) override;
626  QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
627  QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
628 
634  QString ruleKey() const { return mRuleKey; }
635 
641  bool isCheckable() const { return mCheckable; }
642 
643  private:
644  QColor mColor;
645  QString mLabel;
646  bool mCheckable = false;
647  QString mRuleKey;
648 };
649 
650 class QgsImageFetcher;
651 
659 {
660  Q_OBJECT
661 
662  public:
663 
669  QgsWmsLegendNode( QgsLayerTreeLayer *nodeLayer, QObject *parent SIP_TRANSFERTHIS = nullptr );
670 
671  ~QgsWmsLegendNode() override;
672 
673  QVariant data( int role ) const override;
674 
675  QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
676 
677  QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
678 
679  void invalidateMapBasedData() override;
680 
681  private slots:
682 
683  void getLegendGraphicFinished( const QImage & );
684  void getLegendGraphicErrored( const QString & );
685  void getLegendGraphicProgress( qint64, qint64 );
686 
687  private:
688 
689  // Lazily initializes mImage
690  QImage getLegendGraphic() const;
691 
692  QImage renderMessage( const QString &msg ) const;
693 
694  QImage mImage;
695 
696  bool mValid;
697 
698  mutable std::unique_ptr<QgsImageFetcher> mFetcher;
699 };
700 
701 
708 {
709  Q_OBJECT
710 
711  public:
713  QgsDataDefinedSizeLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsDataDefinedSizeLegend &settings, QObject *parent SIP_TRANSFERTHIS = nullptr );
714  ~QgsDataDefinedSizeLegendNode() override;
715 
716  QVariant data( int role ) const override;
717 
718  ItemMetrics draw( const QgsLegendSettings &settings, ItemContext *ctx ) override;
719 
720  private:
721  void cacheImage() const;
722  QgsDataDefinedSizeLegend *mSettings = nullptr;
723  mutable QImage mImage;
724 };
725 
732 {
733  public:
734 
741  QgsVectorLabelLegendNode( QgsLayerTreeLayer *nodeLayer, const QgsPalLayerSettings &labelSettings, QObject *parent = nullptr );
742  ~QgsVectorLabelLegendNode() override;
743 
749  QVariant data( int role ) const override;
750 
758  QSizeF drawSymbol( const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight ) const override;
759 
766  QJsonObject exportSymbolToJson( const QgsLegendSettings &settings, const QgsRenderContext &context ) const override;
767 
768  private:
769  QgsPalLayerSettings mLabelSettings;
770  QSizeF drawSymbol( const QgsLegendSettings &settings, const QgsRenderContext &renderContext, double xOffset = 0.0, double yOffset = 0.0 ) const;
771  void textWidthHeight( double &width, double &height, QgsRenderContext &ctx, const QgsTextFormat &textFormat, const QStringList &textLines ) const;
772 };
773 
774 
775 #endif // QGSLAYERTREEMODELLEGENDNODE_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:406
QgsRasterSymbolLegendNode::isCheckable
bool isCheckable() const
Returns whether the item is user-checkable - whether renderer supports enabling/disabling it.
Definition: qgslayertreemodellegendnode.h:641
qgspallabeling.h
QgsImageFetcher
Handles asynchronous download of images.
Definition: qgsrasterdataprovider.h:57
QgsSymbolLegendNode::MINIMUM_SIZE
static double MINIMUM_SIZE
Definition: qgslayertreemodellegendnode.h:364
QgsLayerTreeModelLegendNode::isEmbeddedInParent
virtual bool isEmbeddedInParent() const
Definition: qgslayertreemodellegendnode.h:116
QgsSymbolLegendNode::textOnSymbolTextFormat
QgsTextFormat textOnSymbolTextFormat() const
Returns text format of the label to be shown on top of the symbol.
Definition: qgslayertreemodellegendnode.h:448
QgsLayerTreeModelLegendNode::invalidateMapBasedData
virtual void invalidateMapBasedData()
Notification from model that information from associated map view has changed.
Definition: qgslayertreemodellegendnode.h:166
QgsLayerTreeModelLegendNode::data
virtual QVariant data(int role) const =0
Returns data associated with the item. Must be implemented in derived class.
QgsSymbolLegendNode::MAXIMUM_SIZE
static double MAXIMUM_SIZE
Definition: qgslayertreemodellegendnode.h:365
QgsLayerTreeModelLegendNode::ItemContext::patchSize
QSizeF patchSize
Symbol patch size to render for the node.
Definition: qgslayertreemodellegendnode.h:234
QgsPalLayerSettings
Contains settings for how a map layer will be labeled.
Definition: qgspallabeling.h:86
QgsSimpleLegendNode
Implementation of legend node interface for displaying arbitrary label with icon.
Definition: qgslayertreemodellegendnode.h:544
QgsLayerTreeModelLegendNode::SimpleLegend
@ SimpleLegend
Simple label with icon legend node type.
Definition: qgslayertreemodellegendnode.h:91
QgsLayerTreeModelLegendNode::ItemContext::point
Q_DECL_DEPRECATED QPointF point
Top-left corner of the legend item.
Definition: qgslayertreemodellegendnode.h:183
QgsDataDefinedSizeLegend
Object that keeps configuration of appearance of marker symbol's data-defined size in legend.
Definition: qgsdatadefinedsizelegend.h:42
QgsRenderContext
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:59
qgscolorramplegendnode.h
QgsSymbolLegendNode::isScaleOK
bool isScaleOK(double scale) const override
Definition: qgslayertreemodellegendnode.h:387
QgsLayerTreeModelLegendNode::ItemContext::patchShape
QgsLegendPatchShape patchShape
The patch shape to render for the node.
Definition: qgslayertreemodellegendnode.h:225
QgsLayerTreeModel
The QgsLayerTreeModel class is model implementation for Qt item views framework.
Definition: qgslayertreemodel.h:55
QgsSymbol
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:92
QgsDataDefinedSizeLegendNode
Produces legend node with a marker symbol.
Definition: qgslayertreemodellegendnode.h:707
QgsLayerTreeModelLegendNode::LegendNodeRoles
LegendNodeRoles
Legend node data roles.
Definition: qgslayertreemodellegendnode.h:81
QgsLegendPatchShape
Represents a patch shape for use in map legends.
Definition: qgslegendpatchshape.h:33
QgsVectorLabelLegendNode
Produces legend node for a labeling text symbol.
Definition: qgslayertreemodellegendnode.h:731
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsLayerTreeModelLegendNode::exportSymbolToJson
virtual QJsonObject exportSymbolToJson(const QgsLegendSettings &settings, const QgsRenderContext &context) const
Adds a symbol in base64 string within a JSON object with the key "icon".
Definition: qgslayertreemodellegendnode.cpp:150
QgsLayerTreeModelLegendNode::userLabel
virtual QString userLabel() const
Definition: qgslayertreemodellegendnode.h:119
QgsLayerTreeModelLegendNode::flags
virtual Qt::ItemFlags flags() const
Returns item flags associated with the item. Default implementation returns Qt::ItemIsEnabled.
Definition: qgslayertreemodellegendnode.cpp:57
QgsLayerTreeModelLegendNode::draw
virtual ItemMetrics draw(const QgsLegendSettings &settings, ItemContext *ctx)
Entry point called from QgsLegendRenderer to do the rendering.
Definition: qgslayertreemodellegendnode.cpp:86
Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_POP
Definition: qgis.h:2820
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:186
QgsTextFormat
Container for all settings relating to text rendering.
Definition: qgstextformat.h:40
QgsLayerTreeModelLegendNode::ItemMetrics::labelSize
QSizeF labelSize
Definition: qgslayertreemodellegendnode.h:240
QgsLegendSymbolItem
The class stores information about one class/rule of a vector layer renderer in a unified way that ca...
Definition: qgslegendsymbolitem.h:36
QgsLayerTreeModelLegendNode::EmbeddedWidget
@ EmbeddedWidget
Embedded widget placeholder node type.
Definition: qgslayertreemodellegendnode.h:97
qgsexpressioncontext.h
QgsLayerTreeModelLegendNode::NodeTypeRole
@ NodeTypeRole
Type of node. Added in 3.16.
Definition: qgslayertreemodellegendnode.h:85
QgsLayerTreeModelLegendNode::ImageLegend
@ ImageLegend
Raster image legend node type.
Definition: qgslayertreemodellegendnode.h:94
QgsLayerTreeModelLegendNode::DataDefinedSizeLegend
@ DataDefinedSizeLegend
Marker symbol legend node type.
Definition: qgslayertreemodellegendnode.h:96
QgsLayerTreeModelLegendNode::ColorRampLegend
@ ColorRampLegend
Color ramp legend (since QGIS 3.18)
Definition: qgslayertreemodellegendnode.h:98
QgsLayerTreeLayer
Layer tree node points to a map layer.
Definition: qgslayertreelayer.h:43
QgsSymbolLegendNode::setTextOnSymbolTextFormat
void setTextOnSymbolTextFormat(const QgsTextFormat &format)
Sets format of text to be shown on top of the symbol.
Definition: qgslayertreemodellegendnode.h:454
qgis_sip.h
QgsSymbolLegendNode::setIconSize
void setIconSize(QSize sz)
Set the icon size.
Definition: qgslayertreemodellegendnode.h:395
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsSymbolLegendNode::setTextOnSymbolLabel
void setTextOnSymbolLabel(const QString &label)
Sets label of text to be shown on top of the symbol.
Definition: qgslayertreemodellegendnode.h:442
QgsLegendSettings
The QgsLegendSettings class stores the appearance and layout settings for legend drawing with QgsLege...
Definition: qgslegendsettings.h:38
QgsWmsLegendNode
Implementation of legend node interface for displaying WMS legend entries.
Definition: qgslayertreemodellegendnode.h:658
qgslegendpatchshape.h
QgsLayerTreeModelLegendNode::NodeTypes
NodeTypes
Types of legend nodes.
Definition: qgslayertreemodellegendnode.h:89
QgsLayerTreeModelLegendNode::ParentRuleKeyRole
@ ParentRuleKeyRole
Rule key of the parent legend node - for legends with tree hierarchy (QString). Added in 2....
Definition: qgslayertreemodellegendnode.h:84
QgsLayerTreeModelLegendNode::ItemContext
Definition: qgslayertreemodellegendnode.h:168
QgsLayerTreeModelLegendNode::setEmbeddedInParent
virtual void setEmbeddedInParent(bool embedded)
Definition: qgslayertreemodellegendnode.h:117
QgsLayerTreeModelLegendNode::ItemMetrics::symbolSize
QSizeF symbolSize
Definition: qgslayertreemodellegendnode.h:239
QgsLayerTreeModelLegendNode::RasterSymbolLegend
@ RasterSymbolLegend
Raster symbol legend node type.
Definition: qgslayertreemodellegendnode.h:93
QgsLayerTreeModelLegendNode::columnBreak
virtual bool columnBreak() const
Returns whether a forced column break should occur before the node.
Definition: qgslayertreemodellegendnode.h:158
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext....
Definition: qgsexpressioncontext.h:113
QgsLayerTreeModelLegendNode::setData
virtual bool setData(const QVariant &value, int role)
Sets some data associated with the item. Default implementation does nothing and returns false.
Definition: qgslayertreemodellegendnode.cpp:62
QgsLayerTreeModelLegendNode::ItemMetrics
Definition: qgslayertreemodellegendnode.h:237
QgsLayerTreeModelLegendNode::setUserLabel
virtual void setUserLabel(const QString &userLabel)
Definition: qgslayertreemodellegendnode.h:120
QgsLayerTreeModelLegendNode::layerNode
QgsLayerTreeLayer * layerNode() const
Returns pointer to the parent layer node.
Definition: qgslayertreemodellegendnode.h:102
QgsSymbolLegendNode::setUserLabel
void setUserLabel(const QString &userLabel) override
Definition: qgslayertreemodellegendnode.h:385
QgsImageLegendNode
Implementation of legend node interface for displaying arbitrary raster image.
Definition: qgslayertreemodellegendnode.h:576
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QgsRasterSymbolLegendNode::ruleKey
QString ruleKey() const
Returns the unique identifier of node for identification of the item within renderer.
Definition: qgslayertreemodellegendnode.h:634
QgsSymbolLegendNode::textOnSymbolLabel
QString textOnSymbolLabel() const
Returns label of text to be shown on top of the symbol.
Definition: qgslayertreemodellegendnode.h:436
QgsRasterSymbolLegendNode
Implementation of legend node interface for displaying raster legend entries.
Definition: qgslayertreemodellegendnode.h:606
qgstextformat.h
QgsLayerTreeModelLegendNode::drawSymbol
virtual QSizeF drawSymbol(const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const
Draws symbol on the left side of the item.
Definition: qgslayertreemodellegendnode.cpp:110
QgsMapSettings
The QgsMapSettings class contains configuration for rendering of the map. The rendering itself is don...
Definition: qgsmapsettings.h:88
QgsLayerTreeModelLegendNode::isScaleOK
virtual bool isScaleOK(double scale) const
Definition: qgslayertreemodellegendnode.h:160
QgsSymbolLegendNode
Implementation of legend node interface for displaying preview of vector symbols and their labels and...
Definition: qgslayertreemodellegendnode.h:358
Q_NOWARN_DEPRECATED_PUSH
#define Q_NOWARN_DEPRECATED_PUSH
Definition: qgis.h:2819
SIP_END
#define SIP_END
Definition: qgis_sip.h:203
QgsSymbolLegendNode::iconSize
QSize iconSize() const
Definition: qgslayertreemodellegendnode.h:397
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
QgsLayerTreeModelLegendNode::SymbolLegend
@ SymbolLegend
Vector symbol legend node type.
Definition: qgslayertreemodellegendnode.h:92
QgsLayerTreeModelLegendNode::WmsLegend
@ WmsLegend
WMS legend node type.
Definition: qgslayertreemodellegendnode.h:95
QgsLayerTreeModelLegendNode::setColumnBreak
virtual void setColumnBreak(bool breakBeforeNode)
Sets whether a forced column break should occur before the node.
Definition: qgslayertreemodellegendnode.h:150
QgsLayerTreeModelLegendNode
The QgsLegendRendererItem class is abstract interface for legend items returned from QgsMapLayerLegen...
Definition: qgslayertreemodellegendnode.h:49