|
QGIS API Documentation 3.42.0-Münster (feb80233002)
|
Contains detailed styling information relating to how a layout legend should be rendered. More...
#include <qgslegendstyle.h>
Public Types | |
| enum | Side { Top = 0 , Bottom = 1 , Left = 2 , Right = 3 } |
| Margin sides. More... | |
Public Member Functions | |
| QgsLegendStyle () | |
| Qt::Alignment | alignment () const |
| Returns the alignment for the legend component. | |
| Q_DECL_DEPRECATED QFont | font () const |
| Returns the font used for rendering this legend component. | |
| double | indent () const |
| Returns the indent (in mm) of a group or subgroup. | |
| double | margin (Side side) const |
| Returns the margin (in mm) for the specified side of the component. | |
| void | readXml (const QDomElement &elem, const QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) |
| Reads the component's style definition from an XML element. | |
| void | setAlignment (Qt::Alignment alignment) |
| Sets the alignment for the legend component. | |
| Q_DECL_DEPRECATED void | setFont (const QFont &font) |
| Sets the font used for rendering this legend component. | |
| void | setIndent (double indent) |
| Sets the indent (in mm) of a group or subgroup. | |
| void | setMargin (double margin) |
| Sets all margin sides to the same margin size (in mm). | |
| void | setMargin (Side side, double margin) |
| Sets the margin (in mm) for the specified side of the component. | |
| void | setTextFormat (const QgsTextFormat &format) |
| Sets the text format used for rendering this legend component. | |
| QgsTextFormat & | textFormat () |
| Returns the text format used for rendering this legend component. | |
| QgsTextFormat | textFormat () const |
| Returns the text format used for rendering this legend component. | |
| void | updateDataDefinedProperties (QgsRenderContext &context) |
| Updates any data-defined properties in the style, using the specified render context. | |
| void | writeXml (const QString &name, QDomElement &elem, QDomDocument &doc, const QgsReadWriteContext &context=QgsReadWriteContext()) const |
| Writes the component's style definition to an XML element. | |
Static Public Member Functions | |
| static Qgis::LegendComponent | styleFromName (const QString &styleName) |
| Returns the style from name string. | |
| static QString | styleLabel (Qgis::LegendComponent s) |
| Returns a translated string representing a style component, for use in UI. | |
| static QString | styleName (Qgis::LegendComponent s) |
| Returns the name for a style component as a string. | |
Contains detailed styling information relating to how a layout legend should be rendered.
Definition at line 36 of file qgslegendstyle.h.
| enum QgsLegendStyle::Side |
Margin sides.
| Enumerator | |
|---|---|
| Top | Top side. |
| Bottom | Bottom side. |
| Left | Left side. |
| Right | Right side. |
Definition at line 43 of file qgslegendstyle.h.
| QgsLegendStyle::QgsLegendStyle | ( | ) |
Definition at line 31 of file qgslegendstyle.cpp.
|
inline |
Returns the alignment for the legend component.
Definition at line 118 of file qgslegendstyle.h.
|
inline |
Returns the font used for rendering this legend component.
Definition at line 58 of file qgslegendstyle.h.
|
inline |
Returns the indent (in mm) of a group or subgroup.
Definition at line 134 of file qgslegendstyle.h.
|
inline |
Returns the margin (in mm) for the specified side of the component.
Definition at line 95 of file qgslegendstyle.h.
| void QgsLegendStyle::readXml | ( | const QDomElement & | elem, |
| const QDomDocument & | doc, | ||
| const QgsReadWriteContext & | context = QgsReadWriteContext() |
||
| ) |
Reads the component's style definition from an XML element.
Definition at line 84 of file qgslegendstyle.cpp.
|
inline |
Sets the alignment for the legend component.
Definition at line 126 of file qgslegendstyle.h.
| void QgsLegendStyle::setFont | ( | const QFont & | font | ) |
Sets the font used for rendering this legend component.
Definition at line 35 of file qgslegendstyle.cpp.
|
inline |
Sets the indent (in mm) of a group or subgroup.
Definition at line 142 of file qgslegendstyle.h.
| void QgsLegendStyle::setMargin | ( | double | margin | ) |
Sets all margin sides to the same margin size (in mm).
Definition at line 50 of file qgslegendstyle.cpp.
|
inline |
Sets the margin (in mm) for the specified side of the component.
Definition at line 104 of file qgslegendstyle.h.
|
inline |
Sets the text format used for rendering this legend component.
Definition at line 86 of file qgslegendstyle.h.
|
static |
Returns the style from name string.
Definition at line 143 of file qgslegendstyle.cpp.
|
static |
Returns a translated string representing a style component, for use in UI.
Definition at line 160 of file qgslegendstyle.cpp.
|
static |
Returns the name for a style component as a string.
This is a non-localised version, for internal use.
Definition at line 121 of file qgslegendstyle.cpp.
|
inline |
Returns the text format used for rendering this legend component.
Definition at line 72 of file qgslegendstyle.h.
|
inline |
Returns the text format used for rendering this legend component.
Definition at line 79 of file qgslegendstyle.h.
| void QgsLegendStyle::updateDataDefinedProperties | ( | QgsRenderContext & | context | ) |
Updates any data-defined properties in the style, using the specified render context.
Definition at line 114 of file qgslegendstyle.cpp.
| void QgsLegendStyle::writeXml | ( | const QString & | name, |
| QDomElement & | elem, | ||
| QDomDocument & | doc, | ||
| const QgsReadWriteContext & | context = QgsReadWriteContext() |
||
| ) | const |
Writes the component's style definition to an XML element.
Definition at line 58 of file qgslegendstyle.cpp.