QGIS API Documentation  2.99.0-Master (37c43df)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsComposerLegendItem Class Referenceabstract

Abstract base class for the legend item types. More...

#include <qgscomposerlegenditem.h>

Inheritance diagram for QgsComposerLegendItem:
Inheritance graph
[legend]

Public Types

enum  ItemType {
  GroupItem = QStandardItem::UserType, LayerItem, SymbologyV2Item, RasterSymbolItem,
  StyleItem
}
 

Public Member Functions

 QgsComposerLegendItem (QgsComposerLegendStyle::Style s=QgsComposerLegendStyle::Undefined)
 
 QgsComposerLegendItem (const QString &text, QgsComposerLegendStyle::Style s=QgsComposerLegendStyle::Undefined)
 
 QgsComposerLegendItem (const QIcon &icon, const QString &text, QgsComposerLegendStyle::Style s=QgsComposerLegendStyle::Undefined)
 
virtual ~QgsComposerLegendItem ()
 
virtual QStandardItem * clone () const override=0
 
virtual ItemType itemType () const =0
 
virtual void readXml (const QDomElement &itemElem, bool xServerAvailable=true)=0
 Read item content from xml. More...
 
void setStyle (QgsComposerLegendStyle::Style style)
 
virtual void setUserText (const QString &text)
 
QgsComposerLegendStyle::Style style () const
 
virtual QString userText () const
 
virtual void writeXml (QDomElement &elem, QDomDocument &doc) const =0
 

Protected Member Functions

void writeXmlChildren (QDomElement &elem, QDomDocument &doc) const
 

Protected Attributes

QgsComposerLegendStyle::Style mStyle
 
QString mUserText
 

Detailed Description

Abstract base class for the legend item types.

Definition at line 29 of file qgscomposerlegenditem.h.

Member Enumeration Documentation

§ ItemType

Enumerator
GroupItem 
LayerItem 
SymbologyV2Item 
RasterSymbolItem 
StyleItem 

Definition at line 37 of file qgscomposerlegenditem.h.

Constructor & Destructor Documentation

§ QgsComposerLegendItem() [1/3]

QgsComposerLegendItem::QgsComposerLegendItem ( QgsComposerLegendStyle::Style  s = QgsComposerLegendStyle::Undefined)

Definition at line 31 of file qgscomposerlegenditem.cpp.

§ QgsComposerLegendItem() [2/3]

QgsComposerLegendItem::QgsComposerLegendItem ( const QString &  text,
QgsComposerLegendStyle::Style  s = QgsComposerLegendStyle::Undefined 
)

Definition at line 36 of file qgscomposerlegenditem.cpp.

§ QgsComposerLegendItem() [3/3]

QgsComposerLegendItem::QgsComposerLegendItem ( const QIcon &  icon,
const QString &  text,
QgsComposerLegendStyle::Style  s = QgsComposerLegendStyle::Undefined 
)

Definition at line 41 of file qgscomposerlegenditem.cpp.

§ ~QgsComposerLegendItem()

QgsComposerLegendItem::~QgsComposerLegendItem ( )
virtual

Definition at line 46 of file qgscomposerlegenditem.cpp.

Member Function Documentation

§ clone()

virtual QStandardItem* QgsComposerLegendItem::clone ( ) const
overridepure virtual

§ itemType()

virtual ItemType QgsComposerLegendItem::itemType ( ) const
pure virtual

§ readXml()

virtual void QgsComposerLegendItem::readXml ( const QDomElement &  itemElem,
bool  xServerAvailable = true 
)
pure virtual

Read item content from xml.

Parameters
itemElemitem to read from
xServerAvailableRead item icons if true (QIcon needs x-server)

Implemented in QgsComposerGroupItem, QgsComposerLayerItem, QgsComposerRasterSymbolItem, and QgsComposerSymbolItem.

§ setStyle()

void QgsComposerLegendItem::setStyle ( QgsComposerLegendStyle::Style  style)
inline

Definition at line 57 of file qgscomposerlegenditem.h.

§ setUserText()

virtual void QgsComposerLegendItem::setUserText ( const QString &  text)
inlinevirtual

Definition at line 62 of file qgscomposerlegenditem.h.

§ style()

QgsComposerLegendStyle::Style QgsComposerLegendItem::style ( ) const
inline

Definition at line 56 of file qgscomposerlegenditem.h.

§ userText()

virtual QString QgsComposerLegendItem::userText ( ) const
inlinevirtual

Definition at line 60 of file qgscomposerlegenditem.h.

§ writeXml()

virtual void QgsComposerLegendItem::writeXml ( QDomElement &  elem,
QDomDocument &  doc 
) const
pure virtual

§ writeXmlChildren()

void QgsComposerLegendItem::writeXmlChildren ( QDomElement &  elem,
QDomDocument &  doc 
) const
protected

Definition at line 50 of file qgscomposerlegenditem.cpp.

Member Data Documentation

§ mStyle

QgsComposerLegendStyle::Style QgsComposerLegendItem::mStyle
protected

Definition at line 67 of file qgscomposerlegenditem.h.

§ mUserText

QString QgsComposerLegendItem::mUserText
protected

Definition at line 70 of file qgscomposerlegenditem.h.


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