Subgroup: Text
Class: QgsTextShadowSettings¶
-
class
qgis.core.
QgsTextShadowSettings
¶ Bases:
sip.wrapper
QgsTextShadowSettings(other: QgsTextShadowSettings) Copy constructor.
Parameters: other – source QgsTextShadowSettings Container for settings relating to a text shadow.
Note
QgsTextShadowSettings objects are implicitly shared.
New in version 3.0: Methods
blendMode
Returns the blending mode used for drawing the drop shadow. blurAlphaOnly
Returns whether only the alpha channel for the shadow will be blurred. blurRadius
Returns the blur radius for the shadow. blurRadiusMapUnitScale
Returns the map unit scale object for the shadow blur radius. blurRadiusUnit
Returns the units used for the shadow’s blur radius. color
Returns the color of the drop shadow. enabled
Returns whether the shadow is enabled. offsetAngle
Returns the angle for offsetting the position of the shadow from the text. offsetDistance
Returns the distance for offsetting the position of the shadow from the text. offsetGlobal
Returns true if the global shadow offset will be used. offsetMapUnitScale
Returns the map unit scale object for the shadow offset distance. offsetUnit
Returns the units used for the shadow’s offset. opacity
Returns the shadow’s opacity. readFromLayer
Reads settings from a layer’s custom properties (for QGIS 2.x projects). readXml
Read settings from a DOM element. scale
Returns the scaling used for the drop shadow (in percentage of original size). setBlendMode
Sets the blending mode used for drawing the drop shadow. setBlurAlphaOnly
Sets whether only the alpha channel for the shadow should be blurred. setBlurRadius
Sets the blur radius for the shadow. setBlurRadiusMapUnitScale
Sets the map unit scale object for the shadow blur radius. setBlurRadiusUnit
Sets the units used for the shadow’s blur radius. setColor
Sets the color for the drop shadow. setEnabled
Sets whether the text shadow will be drawn. setOffsetAngle
Sets the angle for offsetting the position of the shadow from the text. setOffsetDistance
Sets the distance for offsetting the position of the shadow from the text. setOffsetGlobal
Sets whether the global shadow offset should be used. setOffsetMapUnitScale
Sets the map unit scale object for the shadow offset distance. setOffsetUnit
Sets the units used for the shadow’s offset. setOpacity
Sets the shadow’s opacity. setScale
Sets the scaling used for the drop shadow (in percentage of original size). setShadowPlacement
Sets the placement for the drop shadow. shadowPlacement
Returns the placement for the drop shadow. writeXml
Write settings into a DOM element. Signals
Attributes
ShadowBuffer
ShadowLowest
ShadowShape
ShadowText
-
ShadowBuffer
= 2¶
-
ShadowLowest
= 0¶
-
class
ShadowPlacement
¶ Bases:
int
-
ShadowShape
= 3¶
-
ShadowText
= 1¶
-
blendMode
(self) → QPainter.CompositionMode¶ Returns the blending mode used for drawing the drop shadow.
See also
-
blurAlphaOnly
(self) → bool¶ Returns whether only the alpha channel for the shadow will be blurred.
See also
-
blurRadius
(self) → float¶ Returns the blur radius for the shadow. Radius units are retrieved via blurRadiusUnits().
See also
See also
-
blurRadiusMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale object for the shadow blur radius. This is only used if the blurRadiusUnit() is set to QgsUnitTypes.RenderMapUnit.
See also
See also
-
blurRadiusUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units used for the shadow’s blur radius.
See also
See also
-
color
(self) → QColor¶ Returns the color of the drop shadow.
See also
-
enabled
(self) → bool¶ Returns whether the shadow is enabled.
See also
-
offsetAngle
(self) → int¶ Returns the angle for offsetting the position of the shadow from the text.
See also
See also
-
offsetDistance
(self) → float¶ Returns the distance for offsetting the position of the shadow from the text. Offset units are retrieved via offsetUnit().
See also
See also
-
offsetGlobal
(self) → bool¶ Returns true if the global shadow offset will be used.
See also
-
offsetMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale object for the shadow offset distance. This is only used if the offsetUnit() is set to QgsUnitTypes.RenderMapUnit.
See also
See also
-
offsetUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units used for the shadow’s offset.
See also
See also
-
opacity
(self) → float¶ Returns the shadow’s opacity. The opacity is a double value between 0 (fully transparent) and 1 (totally opaque).
See also
-
readFromLayer
(self, layer: QgsVectorLayer)¶ Reads settings from a layer’s custom properties (for QGIS 2.x projects).
Parameters: layer – source vector layer
-
readXml
(self, elem: QDomElement)¶ Read settings from a DOM element.
See also
-
scale
(self) → int¶ Returns the scaling used for the drop shadow (in percentage of original size).
See also
-
setBlendMode
(self, mode: QPainter.CompositionMode)¶ Sets the blending mode used for drawing the drop shadow.
Parameters: mode – blending mode See also
-
setBlurAlphaOnly
(self, alphaOnly: bool)¶ Sets whether only the alpha channel for the shadow should be blurred.
Parameters: alphaOnly – set to true to blur only the alpha channel. If false, all channels (including red, green and blue channel) will be blurred. See also
-
setBlurRadius
(self, blurRadius: float)¶ Sets the blur radius for the shadow. Radius units are specified via setBlurRadiusUnits().
Parameters: blurRadius – blur radius See also
See also
-
setBlurRadiusMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit scale object for the shadow blur radius. This is only used if the blurRadiusUnit() is set to QgsUnitTypes.RenderMapUnit.
Parameters: scale – scale for shadow blur radius See also
See also
-
setBlurRadiusUnit
(self, units: QgsUnitTypes.RenderUnit)¶ Sets the units used for the shadow’s blur radius.
Parameters: units – shadow blur radius units See also
See also
-
setColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the color for the drop shadow.
Parameters: color – shadow color See also
-
setEnabled
(self, enabled: bool)¶ Sets whether the text shadow will be drawn.
Parameters: enabled – set to true to draw shadow See also
-
setOffsetAngle
(self, angle: int)¶ Sets the angle for offsetting the position of the shadow from the text.
Parameters: angle – offset angle in degrees See also
See also
-
setOffsetDistance
(self, distance: float)¶ Sets the distance for offsetting the position of the shadow from the text. Offset units are specified via setOffsetUnit().
Parameters: distance – offset distance See also
See also
-
setOffsetGlobal
(self, global_: bool)¶ Sets whether the global shadow offset should be used.
Parameters: global – set to true to use global shadow offset.
-
setOffsetMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit scale object for the shadow offset distance. This is only used if the offsetUnit() is set to QgsUnitTypes.RenderMapUnit.
Parameters: scale – scale for shadow offset See also
See also
-
setOffsetUnit
(self, units: QgsUnitTypes.RenderUnit)¶ Sets the units used for the shadow’s offset.
Parameters: units – shadow distance units See also
See also
-
setOpacity
(self, opacity: float)¶ Sets the shadow’s opacity.
Parameters: opacity – opacity as a double value between 0 (fully transparent) and 1 (totally opaque) See also
-
setScale
(self, scale: int)¶ Sets the scaling used for the drop shadow (in percentage of original size).
Parameters: scale – scale percent for drop shadow See also
-
setShadowPlacement
(self, placement: QgsTextShadowSettings.ShadowPlacement)¶ 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 – shadow placement See also
-
shadowPlacement
(self) → QgsTextShadowSettings.ShadowPlacement¶ 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
-