QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Signals | Public Member Functions | Static Public Member Functions | List of all members
QgsMapLayerLegend Class Referenceabstract

The QgsMapLayerLegend class is abstract interface for implementations of legends for one map layer. More...

#include <qgsmaplayerlegend.h>

Inheritance diagram for QgsMapLayerLegend:
Inheritance graph
[legend]

Signals

void itemsChanged ()
 Emitted when existing items/nodes got invalid and should be replaced by new ones. More...
 

Public Member Functions

 QgsMapLayerLegend (QObject *parent=nullptr)
 Constructor for QgsMapLayerLegend. More...
 
virtual QList< QgsLayerTreeModelLegendNode * > createLayerTreeModelLegendNodes (QgsLayerTreeLayer *nodeLayer)=0
 Returns list of legend nodes to be used for a particular layer tree layer node. More...
 
virtual void readXml (const QDomElement &elem, const QgsReadWriteContext &context)
 Reads configuration from a DOM element previously written by writeXml() More...
 
virtual QDomElement writeXml (QDomDocument &doc, const QgsReadWriteContext &context) const
 Writes configuration to a DOM element, to be used later with readXml() More...
 

Static Public Member Functions

static QgsMapLayerLegenddefaultMeshLegend (QgsMeshLayer *ml)
 Create new legend implementation for mesh layer. More...
 
static QgsMapLayerLegenddefaultRasterLegend (QgsRasterLayer *rl)
 Create new legend implementation for raster layer. More...
 
static QgsMapLayerLegenddefaultVectorLegend (QgsVectorLayer *vl)
 Create new legend implementation for vector layer. More...
 

Detailed Description

The QgsMapLayerLegend class is abstract interface for implementations of legends for one map layer.

Since
QGIS 2.6

Definition at line 43 of file qgsmaplayerlegend.h.

Constructor & Destructor Documentation

QgsMapLayerLegend::QgsMapLayerLegend ( QObject *  parent = nullptr)
explicit

Constructor for QgsMapLayerLegend.

Definition at line 29 of file qgsmaplayerlegend.cpp.

Member Function Documentation

virtual QList<QgsLayerTreeModelLegendNode *> QgsMapLayerLegend::createLayerTreeModelLegendNodes ( QgsLayerTreeLayer nodeLayer)
pure virtual

Returns list of legend nodes to be used for a particular layer tree layer node.

Ownership is transferred to the caller.

Implemented in QgsDefaultMeshLayerLegend, QgsDefaultRasterLayerLegend, and QgsDefaultVectorLayerLegend.

QgsMapLayerLegend * QgsMapLayerLegend::defaultMeshLegend ( QgsMeshLayer ml)
static

Create new legend implementation for mesh layer.

Definition at line 57 of file qgsmaplayerlegend.cpp.

QgsMapLayerLegend * QgsMapLayerLegend::defaultRasterLegend ( QgsRasterLayer rl)
static

Create new legend implementation for raster layer.

Definition at line 52 of file qgsmaplayerlegend.cpp.

QgsMapLayerLegend * QgsMapLayerLegend::defaultVectorLegend ( QgsVectorLayer vl)
static

Create new legend implementation for vector layer.

Definition at line 47 of file qgsmaplayerlegend.cpp.

void QgsMapLayerLegend::itemsChanged ( )
signal

Emitted when existing items/nodes got invalid and should be replaced by new ones.

void QgsMapLayerLegend::readXml ( const QDomElement &  elem,
const QgsReadWriteContext context 
)
virtual

Reads configuration from a DOM element previously written by writeXml()

Since
QGIS 3.2

Reimplemented in QgsDefaultVectorLayerLegend.

Definition at line 34 of file qgsmaplayerlegend.cpp.

QDomElement QgsMapLayerLegend::writeXml ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const
virtual

Writes configuration to a DOM element, to be used later with readXml()

Since
QGIS 3.2

Reimplemented in QgsDefaultVectorLayerLegend.

Definition at line 40 of file qgsmaplayerlegend.cpp.


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