Class: QgsTextBufferSettings¶
Container for settings relating to a text buffer.
Note
QgsTextBufferSettings objects are implicitly shared.
- class qgis.core.QgsTextBufferSettings[source]¶
Bases:
object- blendMode(self) QPainter.CompositionMode[source]¶
Returns the blending mode used for drawing the buffer.
See also
- Return type:
QPainter.CompositionMode
- fillBufferInterior(self) bool[source]¶
Returns whether the interior of the buffer will be filled in. If
False, only the stroke of the text will be drawn as the buffer. The effect of this setting is only visible for semi-transparent text.See also
- Return type:
bool
- joinStyle(self) Qt.PenJoinStyle[source]¶
Returns the buffer join style.
See also
- Return type:
Qt.PenJoinStyle
- opacity(self) float[source]¶
Returns the buffer opacity. The opacity is a double value between 0 (fully transparent) and 1 (totally opaque).
See also
- Return type:
float
- paintEffect(self) QgsPaintEffect | None[source]¶
Returns the current paint effect for the buffer.
- Return type:
Optional[QgsPaintEffect]
- Returns:
paint effect
See also
- readFromLayer(self, layer: QgsVectorLayer | None)[source]¶
Reads settings from a layer’s custom properties (for QGIS 2.x projects).
- Parameters:
layer (Optional[QgsVectorLayer]) – source vector layer
- readXml(self, elem: QDomElement)[source]¶
Read settings from a DOM element.
See also
- Parameters:
elem (QDomElement)
- referencedFields(self, context: QgsRenderContext) Set[str]¶
Returns all field names referenced by the configuration (e.g. from data defined properties).
Added in version 3.14.
- Parameters:
context (QgsRenderContext)
- Return type:
Set[str]
- setBlendMode(self, mode: QPainter.CompositionMode)[source]¶
Sets the blending mode used for drawing the buffer.
- Parameters:
mode (QPainter.CompositionMode) – blending mode
See also
- setColor(self, color: QColor | Qt.GlobalColor)[source]¶
Sets the color for the buffer.
- Parameters:
color (Union[QColor, Qt.GlobalColor]) – buffer color
See also
- setEnabled(self, enabled: bool)[source]¶
Sets whether the text buffer will be drawn.
- Parameters:
enabled (bool) – set to
Trueto draw buffer
See also
- setFillBufferInterior(self, fill: bool)[source]¶
Sets whether the interior of the buffer will be filled in.
- Parameters:
fill (bool) – set to
Falseto drawn only the stroke of the text as the buffer, orTrueto also shade the area inside the text. The effect of this setting is only visible for semi-transparent text.
See also
- setJoinStyle(self, style: Qt.PenJoinStyle)[source]¶
Sets the join style used for drawing the buffer.
- Parameters:
style (Qt.PenJoinStyle) – join style
See also
- setOpacity(self, opacity: float)[source]¶
Sets the buffer opacity.
- Parameters:
opacity (float) – opacity as a double value between 0 (fully transparent) and 1 (totally opaque)
See also
- setPaintEffect(self, effect: QgsPaintEffect | None)[source]¶
Sets the current paint
effectfor the buffer.- Parameters:
effect (Optional[QgsPaintEffect]) – paint effect. Ownership is transferred to the buffer settings.
See also
- setSize(self, size: float)[source]¶
Sets the size of the buffer. The size units are specified using
setSizeUnit().- Parameters:
size (float) – buffer size
See also
See also
- setSizeMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit scale object for the buffer size. This is only used if the buffer size is set to
QgsUnitTypes.RenderMapUnit.- Parameters:
scale (QgsMapUnitScale) – scale for buffer size
See also
See also
- setSizeUnit(self, unit: Qgis.RenderUnit)[source]¶
Sets the units used for the buffer size.
- Parameters:
unit (Qgis.RenderUnit) – size unit
See also
See also
- sizeMapUnitScale(self) QgsMapUnitScale[source]¶
Returns the map unit scale object for the buffer size. This is only used if the buffer size is set to
QgsUnitTypes.RenderMapUnit.See also
See also
- Return type:
- sizeUnit(self) Qgis.RenderUnit[source]¶
Returns the units for the buffer size.
See also
See also
- Return type:
- updateDataDefinedProperties(self, context: QgsRenderContext, properties: QgsPropertyCollection)[source]¶
Updates the format by evaluating current values of data defined properties.
Added in version 3.10.
- Parameters:
context (QgsRenderContext)
properties (QgsPropertyCollection)