QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsVectorLabelLegendNode Class Reference

Produces legend node for a labeling text symbol. More...

#include <qgslayertreemodellegendnode.h>

Inheritance diagram for QgsVectorLabelLegendNode:
Inheritance graph
[legend]

Public Member Functions

 QgsVectorLabelLegendNode (QgsLayerTreeLayer *nodeLayer, const QgsPalLayerSettings &labelSettings, QObject *parent=nullptr)
 QgsVectorLabelLegendNode. More...
 
 ~QgsVectorLabelLegendNode () override
 
QVariant data (int role) const override
 data Returns data associated with the item More...
 
QSizeF drawSymbol (const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const override
 drawSymbol More...
 
QJsonObject exportSymbolToJson (const QgsLegendSettings &settings, const QgsRenderContext &context) const override
 exportSymbolToJson More...
 
- Public Member Functions inherited from QgsLayerTreeModelLegendNode
virtual bool columnBreak () const
 Returns whether a forced column break should occur before the node. More...
 
virtual QVariant data (int role) const =0
 Returns data associated with the item. Must be implemented in derived class. More...
 
virtual ItemMetrics draw (const QgsLegendSettings &settings, ItemContext *ctx)
 Entry point called from QgsLegendRenderer to do the rendering. More...
 
virtual QSizeF drawSymbol (const QgsLegendSettings &settings, ItemContext *ctx, double itemHeight) const
 Draws symbol on the left side of the item. More...
 
virtual QSizeF drawSymbolText (const QgsLegendSettings &settings, ItemContext *ctx, QSizeF symbolSize) const
 Draws label on the right side of the item. More...
 
virtual QJsonObject exportSymbolToJson (const QgsLegendSettings &settings, const QgsRenderContext &context) const
 Adds a symbol in base64 string within a JSON object with the key "icon". More...
 
QJsonObject exportToJson (const QgsLegendSettings &settings, const QgsRenderContext &context)
 Entry point called from QgsLegendRenderer to do the rendering in a JSON object. More...
 
virtual Qt::ItemFlags flags () const
 Returns item flags associated with the item. Default implementation returns Qt::ItemIsEnabled. More...
 
virtual void invalidateMapBasedData ()
 Notification from model that information from associated map view has changed. More...
 
virtual bool isEmbeddedInParent () const
 
virtual bool isScaleOK (double scale) const
 
QgsLayerTreeLayerlayerNode () const
 Returns pointer to the parent layer node. More...
 
QgsLayerTreeModelmodel () const
 Returns pointer to model owning this legend node. More...
 
virtual void setColumnBreak (bool breakBeforeNode)
 Sets whether a forced column break should occur before the node. More...
 
virtual bool setData (const QVariant &value, int role)
 Sets some data associated with the item. Default implementation does nothing and returns false. More...
 
virtual void setEmbeddedInParent (bool embedded)
 
virtual void setUserLabel (const QString &userLabel)
 
virtual void setUserPatchSize (QSizeF size)
 Sets the user (overridden) size for the legend node. More...
 
virtual QString userLabel () const
 
virtual QSizeF userPatchSize () const
 Returns the user (overridden) size for the legend node. More...
 

Additional Inherited Members

- Public Types inherited from QgsLayerTreeModelLegendNode
enum class  CustomRole : int { RuleKey = Qt::UserRole , ParentRuleKey , NodeType }
 Legend node data roles. More...
 
enum  NodeTypes {
  SimpleLegend , SymbolLegend , RasterSymbolLegend , ImageLegend ,
  WmsLegend , DataDefinedSizeLegend , EmbeddedWidget , ColorRampLegend
}
 Types of legend nodes. More...
 
- Public Slots inherited from QgsLayerTreeModelLegendNode
void checkAllItems ()
 Checks all checkable items belonging to the same layer as this node. More...
 
void toggleAllItems ()
 Toggle all checkable items belonging to the same layer as this node. More...
 
void uncheckAllItems ()
 Unchecks all checkable items belonging to the same layer as this node. More...
 
- Signals inherited from QgsLayerTreeModelLegendNode
void dataChanged ()
 Emitted on internal data change so the layer tree model can forward the signal to views. More...
 
void sizeChanged ()
 Emitted when the size of this node changes. More...
 
- Protected Member Functions inherited from QgsLayerTreeModelLegendNode
 QgsLayerTreeModelLegendNode (QgsLayerTreeLayer *nodeL, QObject *parent=nullptr)
 Construct the node with pointer to its parent layer node. More...
 
QgsRenderContextcreateTemporaryRenderContext () const
 Returns a temporary context or nullptr if legendMapViewData are not valid. More...
 
- Protected Attributes inherited from QgsLayerTreeModelLegendNode
bool mColumnBreakBeforeNode = false
 
bool mEmbeddedInParent
 
QgsLayerTreeLayermLayerNode = nullptr
 
QgsLegendPatchShape mPatchShape
 
QString mUserLabel
 
QSizeF mUserSize
 

Detailed Description

Produces legend node for a labeling text symbol.

Since
QGIS 3.20

Definition at line 814 of file qgslayertreemodellegendnode.h.

Constructor & Destructor Documentation

◆ QgsVectorLabelLegendNode()

QgsVectorLabelLegendNode::QgsVectorLabelLegendNode ( QgsLayerTreeLayer nodeLayer,
const QgsPalLayerSettings labelSettings,
QObject *  parent = nullptr 
)

QgsVectorLabelLegendNode.

Parameters
nodeLayerthe parent node
labelSettingssetting of the label class
parentthe parent object

Definition at line 1566 of file qgslayertreemodellegendnode.cpp.

◆ ~QgsVectorLabelLegendNode()

QgsVectorLabelLegendNode::~QgsVectorLabelLegendNode ( )
override

Definition at line 1570 of file qgslayertreemodellegendnode.cpp.

Member Function Documentation

◆ data()

QVariant QgsVectorLabelLegendNode::data ( int  role) const
overridevirtual

data Returns data associated with the item

Parameters
rolethe data role
Returns
variant containing the data for the role

Implements QgsLayerTreeModelLegendNode.

Definition at line 1574 of file qgslayertreemodellegendnode.cpp.

◆ drawSymbol()

QSizeF QgsVectorLabelLegendNode::drawSymbol ( const QgsLegendSettings settings,
ItemContext ctx,
double  itemHeight 
) const
overridevirtual

drawSymbol

Parameters
settingsthe legend settings
ctxcontext for the item
itemHeightthe height of the item
Returns
size of the item

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 1588 of file qgslayertreemodellegendnode.cpp.

◆ exportSymbolToJson()

QJsonObject QgsVectorLabelLegendNode::exportSymbolToJson ( const QgsLegendSettings settings,
const QgsRenderContext context 
) const
overridevirtual

exportSymbolToJson

Parameters
settingsthe legend settings
contextthe item context
Returns
the json object

Reimplemented from QgsLayerTreeModelLegendNode.

Definition at line 1624 of file qgslayertreemodellegendnode.cpp.


The documentation for this class was generated from the following files: