QgsLegendStyle class

Composer legend components style.

Public types

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

Public static functions

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

Public functions

auto font() const -> QFont
The font for this style.
auto rfont() -> QFont&
Modifiable reference to font.
void setFont(const QFont& font)
The font for this style.
void setMargin(double margin)
Sets all margins.

Enum documentation

enum QgsLegendStyle::Style

Enumerators
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

Function documentation

QFont& QgsLegendStyle::rfont()

Modifiable reference to font.