Class: QgsTextShadowSettings¶
Container for settings relating to a text shadow.
Note
QgsTextShadowSettings
objects are implicitly shared.
Methods
Returns the blending mode used for drawing the drop shadow. |
|
Returns whether only the alpha channel for the shadow will be blurred. |
|
Returns the blur radius for the shadow. |
|
Returns the map unit scale object for the shadow blur radius. |
|
Returns the units used for the shadow's blur radius. |
|
Returns the color of the drop shadow. |
|
Returns whether the shadow is enabled. |
|
Returns the angle for offsetting the position of the shadow from the text. |
|
Returns the distance for offsetting the position of the shadow from the text. |
|
Returns |
|
Returns the map unit scale object for the shadow offset distance. |
|
Returns the units used for the shadow's offset. |
|
Returns the shadow's opacity. |
|
Reads settings from a layer's custom properties (for QGIS 2.x projects). |
|
Read settings from a DOM element. |
|
Returns all field names referenced by the configuration (e.g. from data defined properties). |
|
Returns the scaling used for the drop shadow (in percentage of original size). |
|
Sets the blending mode used for drawing the drop shadow. |
|
Sets whether only the alpha channel for the shadow should be blurred. |
|
Sets the blur radius for the shadow. |
|
Sets the map unit scale object for the shadow blur radius. |
|
Sets the units used for the shadow's blur radius. |
|
Sets the color for the drop shadow. |
|
Sets whether the text shadow will be drawn. |
|
Sets the angle for offsetting the position of the shadow from the text. |
|
Sets the distance for offsetting the position of the shadow from the text. |
|
Sets whether the global shadow offset should be used. |
|
Sets the map unit scale object for the shadow offset distance. |
|
Sets the units used for the shadow's offset. |
|
Sets the shadow's opacity. |
|
Sets the scaling used for the drop shadow (in percentage of original size). |
|
Sets the placement for the drop shadow. |
|
Returns the placement for the drop shadow. |
|
Updates the format by evaluating current values of data defined properties. |
|
Write settings into a DOM element. |
Attributes
- class qgis.core.QgsTextShadowSettings[source]¶
Bases:
object
- ShadowBuffer = 2¶
- ShadowLowest = 0¶
- class ShadowPlacement¶
Bases:
int
- ShadowShape = 3¶
- ShadowText = 1¶
- blendMode(self) QPainter.CompositionMode [source]¶
Returns the blending mode used for drawing the drop shadow.
See also
- Return type:
QPainter.CompositionMode
- blurAlphaOnly(self) bool [source]¶
Returns whether only the alpha channel for the shadow will be blurred.
See also
- Return type:
bool
- blurRadius(self) float [source]¶
Returns the blur radius for the shadow. Radius units are retrieved via
blurRadiusUnits()
.See also
See also
- Return type:
float
- blurRadiusMapUnitScale(self) QgsMapUnitScale [source]¶
Returns the map unit scale object for the shadow blur radius. This is only used if the
blurRadiusUnit()
is set toQgsUnitTypes
.RenderMapUnit.See also
See also
- Return type:
- blurRadiusUnit(self) Qgis.RenderUnit [source]¶
Returns the units used for the shadow’s blur radius.
See also
See also
- Return type:
- offsetAngle(self) int [source]¶
Returns the angle for offsetting the position of the shadow from the text.
See also
See also
- Return type:
int
- offsetDistance(self) float [source]¶
Returns the distance for offsetting the position of the shadow from the text. Offset units are retrieved via
offsetUnit()
.See also
See also
- Return type:
float
- offsetGlobal(self) bool [source]¶
Returns
True
if the global shadow offset will be used.See also
- Return type:
bool
- offsetMapUnitScale(self) QgsMapUnitScale [source]¶
Returns the map unit scale object for the shadow offset distance. This is only used if the
offsetUnit()
is set toQgsUnitTypes
.RenderMapUnit.See also
See also
- Return type:
- offsetUnit(self) Qgis.RenderUnit [source]¶
Returns the units used for the shadow’s offset.
See also
See also
- Return type:
- opacity(self) float [source]¶
Returns the shadow’s opacity. The opacity is a double value between 0 (fully transparent) and 1 (totally opaque).
See also
- Return type:
float
- 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]
- scale(self) int [source]¶
Returns the scaling used for the drop shadow (in percentage of original size).
See also
- Return type:
int
- setBlendMode(self, mode: QPainter.CompositionMode)[source]¶
Sets the blending mode used for drawing the drop shadow.
- Parameters:
mode (QPainter.CompositionMode) – blending mode
See also
- setBlurAlphaOnly(self, alphaOnly: bool)[source]¶
Sets whether only the alpha channel for the shadow should be blurred.
- Parameters:
alphaOnly (bool) – set to
True
to blur only the alpha channel. IfFalse
, all channels (including red, green and blue channel) will be blurred.
See also
- setBlurRadius(self, blurRadius: float)[source]¶
Sets the blur radius for the shadow. Radius units are specified via
setBlurRadiusUnits()
.- Parameters:
blurRadius (float) – blur radius
See also
See also
- setBlurRadiusMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit scale object for the shadow blur radius. This is only used if the
blurRadiusUnit()
is set toQgsUnitTypes
.RenderMapUnit.- Parameters:
scale (QgsMapUnitScale) – scale for shadow blur radius
See also
See also
- setBlurRadiusUnit(self, units: Qgis.RenderUnit)[source]¶
Sets the units used for the shadow’s blur radius.
- Parameters:
units (Qgis.RenderUnit) – shadow blur radius units
See also
See also
- setColor(self, color: QColor | Qt.GlobalColor)[source]¶
Sets the color for the drop shadow.
- Parameters:
color (Union[QColor, Qt.GlobalColor]) – shadow color
See also
- setEnabled(self, enabled: bool)[source]¶
Sets whether the text shadow will be drawn.
- Parameters:
enabled (bool) – set to
True
to draw shadow
See also
- setOffsetAngle(self, angle: int)[source]¶
Sets the angle for offsetting the position of the shadow from the text.
- Parameters:
angle (int) – offset angle in degrees
See also
See also
- setOffsetDistance(self, distance: float)[source]¶
Sets the distance for offsetting the position of the shadow from the text. Offset units are specified via
setOffsetUnit()
.- Parameters:
distance (float) – offset distance
See also
See also
- setOffsetGlobal(self, global_: bool)[source]¶
Sets whether the global shadow offset should be used.
- Parameters:
global (bool) – set to
True
to use global shadow offset.global
- setOffsetMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
Sets the map unit scale object for the shadow offset distance. This is only used if the
offsetUnit()
is set toQgsUnitTypes
.RenderMapUnit.- Parameters:
scale (QgsMapUnitScale) – scale for shadow offset
See also
See also
- setOffsetUnit(self, units: Qgis.RenderUnit)[source]¶
Sets the units used for the shadow’s offset.
- Parameters:
units (Qgis.RenderUnit) – shadow distance units
See also
See also
- setOpacity(self, opacity: float)[source]¶
Sets the shadow’s opacity.
- Parameters:
opacity (float) – opacity as a double value between 0 (fully transparent) and 1 (totally opaque)
See also
- setScale(self, scale: int)[source]¶
Sets the scaling used for the drop shadow (in percentage of original size).
- Parameters:
scale (int) – scale percent for drop shadow
See also
- setShadowPlacement(self, placement: QgsTextShadowSettings.ShadowPlacement)[source]¶
Sets the placement for the drop shadow. The placement determines both the z-order stacking position for the shadow and the what shape (e.g., text, background shape) is used for casting the shadow.
- Parameters:
placement (QgsTextShadowSettings.ShadowPlacement) – shadow placement
See also
- shadowPlacement(self) QgsTextShadowSettings.ShadowPlacement [source]¶
Returns the placement for the drop shadow. The placement determines both the z-order stacking position for the shadow and the what shape (e.g., text, background shape) is used for casting the shadow.
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)