Class: QgsTextMaskSettings¶
Container for settings relating to a selective masking around a text.
A selective masking only makes sense in contexts where the text is rendered over some other map layers, especially for labeling.
Note
QgsTextMaskSettings objects are implicitly shared.
Added in version 3.12.
- class qgis.core.QgsTextMaskSettings[source]¶
Bases:
object- MaskBuffer = 0¶
- class MaskType¶
Bases:
int
- joinStyle(self) Qt.PenJoinStyle[source]¶
Returns the buffer join style.
See also
- Return type:
Qt.PenJoinStyle
- maskedSymbolLayers(self) List[QgsSymbolLayerReference]¶
Returns a list of references to symbol layers that are masked by this buffer.
- Return type:
- Returns:
a list of references to masked symbol layers
See also
- opacity(self) float[source]¶
Returns the mask’s 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 mask.
- Return type:
Optional[QgsPaintEffect]
- Returns:
paint effect
See also
- 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]
- setJoinStyle(self, style: Qt.PenJoinStyle)[source]¶
Sets the join style used for drawing the buffer.
- Parameters:
style (Qt.PenJoinStyle) – join style
See also
- setMaskedSymbolLayers(self, maskedLayers: Iterable[QgsSymbolLayerReference])[source]¶
Sets the symbol layers that will be masked by this buffer.
- Parameters:
maskedLayers (Iterable[QgsSymbolLayerReference]) – list of references to symbol layers
See also
- setOpacity(self, opacity: float)[source]¶
Sets the mask’s 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 mask.- Parameters:
effect (Optional[QgsPaintEffect]) – paint effect. Ownership is transferred to the mask 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
- setType(self, type: QgsTextMaskSettings.MaskType)[source]¶
Sets the type of mask shape.
- Parameters:
type (QgsTextMaskSettings.MaskType) – shape type
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:
- type(self) QgsTextMaskSettings.MaskType[source]¶
Returns the type of mask shape.
See also
- Return type:
- updateDataDefinedProperties(self, context: QgsRenderContext, properties: QgsPropertyCollection)[source]¶
Updates the format by evaluating current values of data defined properties.
- Parameters:
context (QgsRenderContext)
properties (QgsPropertyCollection)