QGIS API Documentation  3.6.0-Noosa (5873452)
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsLegendStyle Class Reference

Composer legend components style. More...

#include <qgslegendstyle.h>

Public Types

enum  Side { Top = 0, Bottom = 1, Left = 2, Right = 3 }
 Margin side. More...
 
enum  Style {
  Undefined, Hidden, Title, Group,
  Subgroup, Symbol, SymbolLabel
}
 

Public Member Functions

 QgsLegendStyle ()
 
QFont font () const
 The font for this style. More...
 
double margin (Side side)
 
void readXml (const QDomElement &elem, const QDomDocument &doc)
 
QFont & rfont ()
 Modifiable reference to font. More...
 
void setFont (const QFont &font)
 The font for this style. More...
 
void setMargin (Side side, double margin)
 
void setMargin (double margin)
 Sets all margins. More...
 
void writeXml (const QString &name, QDomElement &elem, QDomDocument &doc) const
 

Static Public Member Functions

static Style styleFromName (const QString &styleName)
 Gets style from name, used in project file. More...
 
static QString styleLabel (Style s)
 Gets style label, translated, used in UI. More...
 
static QString styleName (Style s)
 Gets name for style, used in project file. More...
 

Detailed Description

Composer legend components style.

Definition at line 34 of file qgslegendstyle.h.

Member Enumeration Documentation

◆ Side

Margin side.

Enumerator
Top 
Bottom 
Left 
Right 

Definition at line 49 of file qgslegendstyle.h.

◆ Style

Enumerator
Undefined 

Should not happen, only if corrupted project file.

Hidden 

Special style, item is hidden including margins around.

Title 
Group 
Subgroup 

Layer.

Symbol 

Symbol without label.

SymbolLabel 

Definition at line 37 of file qgslegendstyle.h.

Constructor & Destructor Documentation

◆ QgsLegendStyle()

QgsLegendStyle::QgsLegendStyle ( )

Definition at line 30 of file qgslegendstyle.cpp.

Member Function Documentation

◆ font()

QFont QgsLegendStyle::font ( ) const
inline

The font for this style.

Definition at line 62 of file qgslegendstyle.h.

◆ margin()

double QgsLegendStyle::margin ( Side  side)
inline

Definition at line 77 of file qgslegendstyle.h.

◆ readXml()

void QgsLegendStyle::readXml ( const QDomElement &  elem,
const QDomDocument &  doc 
)

Definition at line 67 of file qgslegendstyle.cpp.

◆ rfont()

QFont& QgsLegendStyle::rfont ( )
inline

Modifiable reference to font.

See also
setFont()
Note
Not available in Python bindings

Definition at line 75 of file qgslegendstyle.h.

◆ setFont()

void QgsLegendStyle::setFont ( const QFont &  font)
inline

The font for this style.

Definition at line 67 of file qgslegendstyle.h.

◆ setMargin() [1/2]

void QgsLegendStyle::setMargin ( Side  side,
double  margin 
)
inline

Definition at line 78 of file qgslegendstyle.h.

◆ setMargin() [2/2]

void QgsLegendStyle::setMargin ( double  margin)

Sets all margins.

Definition at line 41 of file qgslegendstyle.cpp.

◆ styleFromName()

QgsLegendStyle::Style QgsLegendStyle::styleFromName ( const QString &  styleName)
static

Gets style from name, used in project file.

Definition at line 105 of file qgslegendstyle.cpp.

◆ styleLabel()

QString QgsLegendStyle::styleLabel ( Style  s)
static

Gets style label, translated, used in UI.

Definition at line 116 of file qgslegendstyle.cpp.

◆ styleName()

QString QgsLegendStyle::styleName ( Style  s)
static

Gets name for style, used in project file.

Definition at line 83 of file qgslegendstyle.cpp.

◆ writeXml()

void QgsLegendStyle::writeXml ( const QString &  name,
QDomElement &  elem,
QDomDocument &  doc 
) const

Definition at line 49 of file qgslegendstyle.cpp.


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