Class: QgsLegendStyle¶
-
class
qgis.core.
QgsLegendStyle
¶ Bases:
sip.wrapper
Contains detailed styling information relating to how a layout legend should be rendered.
Enums
Methods
Returns the alignment for the legend component.
Returns the font used for rendering this legend component.
Returns the margin (in mm) for the specified
side
of the component.Reads the component’s style definition from an XML element.
Sets the alignment for the legend component.
Sets the
font
used for rendering this legend component.Sets the
margin
(in mm) for the specifiedside
of the component.Returns the style from name string.
Returns a translated string representing a style component, for use in UI.
Returns the name for a style component as a string.
Writes the component’s style definition to an XML element.
Signals
Attributes
-
Bottom
= 1¶
-
Group
= 3¶
-
Hidden
= 1¶
-
Left
= 2¶
-
Right
= 3¶
-
class
Side
¶ Bases:
int
-
class
Style
¶ Bases:
int
-
Subgroup
= 4¶
-
Symbol
= 5¶
-
SymbolLabel
= 6¶
-
Title
= 2¶
-
Top
= 0¶
-
Undefined
= 0¶
-
alignment
(self) → Qt.Alignment¶ Returns the alignment for the legend component.
See also
New in version 3.10.
-
margin
(self, side: QgsLegendStyle.Side) → float¶ Returns the margin (in mm) for the specified
side
of the component.Note
Not all legend components respect all margin side settings!
See also
-
readXml
(self, elem: QDomElement, doc: QDomDocument)¶ Reads the component’s style definition from an XML element.
See also
-
setAlignment
(self, alignment: Union[Qt.Alignment, Qt.AlignmentFlag])¶ Sets the alignment for the legend component.
See also
New in version 3.10.
-
setMargin
(self, side: QgsLegendStyle.Side, margin: float)¶ Sets the
margin
(in mm) for the specifiedside
of the component.Note
Not all legend components respect all margin side settings!
See also
setMargin(self, margin: float) Sets all margin sides to the same
margin
size (in mm).See also
-
styleFromName
(styleName: str) → QgsLegendStyle.Style¶ Returns the style from name string.
See also
-
styleLabel
(s: QgsLegendStyle.Style) → str¶ Returns a translated string representing a style component, for use in UI.
See also
-
styleName
(s: QgsLegendStyle.Style) → str¶ Returns the name for a style component as a string.
This is a non-localised version, for internal use.
See also
See also
-