QGIS API Documentation  2.11.0-Master
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

Public Types

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

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 QStandardItemclone () 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
- Public Member Functions inherited from QStandardItem
 QStandardItem ()
 QStandardItem (const QString &text)
 QStandardItem (int rows, int columns)
 QStandardItem (const QIcon &icon, const QString &text)
virtual  ~QStandardItem ()
QString accessibleDescription () const
QString accessibleText () const
void appendColumn (const QList< QStandardItem * > &items)
void appendRow (const QList< QStandardItem * > &items)
void appendRow (QStandardItem *item)
void appendRows (const QList< QStandardItem * > &items)
QBrush background () const
Qt::CheckState checkState () const
QStandardItemchild (int row, int column) const
int column () const
int columnCount () const
virtual QVariant data (int role) const
Qt::ItemFlags flags () const
QFont font () const
QBrush foreground () const
bool hasChildren () const
QIcon icon () const
QModelIndex index () const
void insertColumn (int column, const QList< QStandardItem * > &items)
void insertColumns (int column, int count)
void insertRow (int row, QStandardItem *item)
void insertRow (int row, const QList< QStandardItem * > &items)
void insertRows (int row, const QList< QStandardItem * > &items)
void insertRows (int row, int count)
bool isCheckable () const
bool isDragEnabled () const
bool isDropEnabled () const
bool isEditable () const
bool isEnabled () const
bool isSelectable () const
bool isTristate () const
QStandardItemModelmodel () const
virtual bool operator< (const QStandardItem &other) const
QStandardItemparent () const
virtual void read (QDataStream &in)
void removeColumn (int column)
void removeColumns (int column, int count)
void removeRow (int row)
void removeRows (int row, int count)
int row () const
int rowCount () const
void setAccessibleDescription (const QString &accessibleDescription)
void setAccessibleText (const QString &accessibleText)
void setBackground (const QBrush &brush)
void setCheckable (bool checkable)
void setCheckState (Qt::CheckState state)
void setChild (int row, int column, QStandardItem *item)
void setChild (int row, QStandardItem *item)
void setColumnCount (int columns)
virtual void setData (const QVariant &value, int role)
void setDragEnabled (bool dragEnabled)
void setDropEnabled (bool dropEnabled)
void setEditable (bool editable)
void setEnabled (bool enabled)
void setFlags (QFlags< Qt::ItemFlag > flags)
void setFont (const QFont &font)
void setForeground (const QBrush &brush)
void setIcon (const QIcon &icon)
void setRowCount (int rows)
void setSelectable (bool selectable)
void setSizeHint (const QSize &size)
void setStatusTip (const QString &statusTip)
void setText (const QString &text)
void setTextAlignment (QFlags< Qt::AlignmentFlag > alignment)
void setToolTip (const QString &toolTip)
void setTristate (bool tristate)
void setWhatsThis (const QString &whatsThis)
QSize sizeHint () const
void sortChildren (int column, Qt::SortOrder order)
QString statusTip () const
QStandardItemtakeChild (int row, int column)
QList< QStandardItem * > takeColumn (int column)
QList< QStandardItem * > takeRow (int row)
QString text () const
Qt::Alignment textAlignment () const
QString toolTip () const
virtual int type () const
QString whatsThis () const
virtual void write (QDataStream &out) const

Protected Member Functions

void writeXMLChildren (QDomElement &elem, QDomDocument &doc) const
- Protected Member Functions inherited from QStandardItem
 QStandardItem (const QStandardItem &other)
void emitDataChanged ()
QStandardItemoperator= (const QStandardItem &other)

Protected Attributes

QgsComposerLegendStyle::Style mStyle
QString mUserText

Detailed Description

Abstract base class for the legend item types.

Definition at line 27 of file qgscomposerlegenditem.h.

Member Enumeration Documentation


Definition at line 35 of file qgscomposerlegenditem.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file qgscomposerlegenditem.cpp.

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

Definition at line 36 of file qgscomposerlegenditem.cpp.

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

Definition at line 41 of file qgscomposerlegenditem.cpp.

QgsComposerLegendItem::~QgsComposerLegendItem ( )

Definition at line 46 of file qgscomposerlegenditem.cpp.

Member Function Documentation

virtual QStandardItem* QgsComposerLegendItem::clone ( ) const
overridepure virtual
virtual ItemType QgsComposerLegendItem::itemType ( ) const
pure virtual
virtual void QgsComposerLegendItem::readXML ( const QDomElement itemElem,
bool  xServerAvailable = true 
pure virtual

Read item content from xml.

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

Implemented in QgsComposerGroupItem, QgsComposerLayerItem, QgsComposerRasterSymbolItem, and QgsComposerSymbolV2Item.

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

Definition at line 54 of file qgscomposerlegenditem.h.

virtual void QgsComposerLegendItem::setUserText ( const QString text)

Definition at line 59 of file qgscomposerlegenditem.h.

QgsComposerLegendStyle::Style QgsComposerLegendItem::style ( ) const

Definition at line 53 of file qgscomposerlegenditem.h.

virtual QString QgsComposerLegendItem::userText ( ) const

Definition at line 57 of file qgscomposerlegenditem.h.

virtual void QgsComposerLegendItem::writeXML ( QDomElement elem,
QDomDocument doc 
) const
pure virtual
void QgsComposerLegendItem::writeXMLChildren ( QDomElement elem,
QDomDocument doc 
) const

Definition at line 50 of file qgscomposerlegenditem.cpp.

Member Data Documentation

QgsComposerLegendStyle::Style QgsComposerLegendItem::mStyle

Definition at line 65 of file qgscomposerlegenditem.h.

QString QgsComposerLegendItem::mUserText

Definition at line 68 of file qgscomposerlegenditem.h.

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