Class: QgsGlowEffect¶
-
class
qgis.core.
QgsGlowEffect
¶ Bases:
QgsPaintEffect
Base class for paint effect which draw a glow inside or outside a picture.
Methods
Returns the blend mode for the effect
Returns the blur level (radius) for the glow.
Returns the map unit scale used for the glow blur strength (radius).
Returns the units used for the glow blur level (radius).
- param rect
Returns the color for the glow.
Returns the color mode used for the glow.
- param context
Returns the opacity for the effect.
- rtype
Dict[str, str]
Returns the color ramp used for the glow.
- param props
Sets the blend mode for the effect
Sets blur level (radius) for the glow.
Sets the map unit scale used for the glow blur strength (radius).
Sets the units used for the glow blur level (radius).
Sets the color for the glow.
Sets the color mode to use for the glow.
Sets the
opacity
for the effect.Sets the color ramp for the glow.
Sets the spread distance for drawing the glow effect.
Sets the map unit scale used for the spread distance.
Sets the units used for the glow spread distance.
Specifies whether the glow is drawn outside the picture or within the picture.
Returns the spread distance used for drawing the glow effect.
Returns the map unit scale used for the spread distance.
Returns the units used for the glow spread distance.
Attributes
-
ColorRamp
= 1¶
-
class
GlowColorType
¶ Bases:
int
-
SingleColor
= 0¶
-
blendMode
(self) → QPainter.CompositionMode¶ Returns the blend mode for the effect
- Return type
QPainter.CompositionMode
- Returns
blend mode used for drawing the effect on to a destination paint device
See also
-
blurLevel
(self) → float¶ Returns the blur level (radius) for the glow.
- Return type
float
- Returns
blur level.
See also
See also
See also
-
blurMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale used for the glow blur strength (radius).
- Return type
- Returns
map unit scale for blur strength
See also
See also
See also
New in version 3.4.9.
-
blurUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units used for the glow blur level (radius).
- Return type
- Returns
units for blur level
See also
See also
See also
New in version 3.4.9.
-
boundingRect
(self, rect: QRectF, context: QgsRenderContext) → QRectF¶ - Parameters
rect (QRectF) –
context (QgsRenderContext) –
- Return type
QRectF
-
color
(self) → QColor¶ Returns the color for the glow. This only applies if the colorType() is set to SingleColor. The glow will fade between the specified color and a totally transparent version of the color.
- Return type
QColor
- Returns
glow color
See also
See also
-
colorType
(self) → QgsGlowEffect.GlowColorType¶ Returns the color mode used for the glow. The glow can either be drawn using a
QgsColorRamp
color ramp or by specificing a single color.- Return type
- Returns
current color mode used for the glow
See also
See also
See also
-
draw
(self, context: QgsRenderContext)¶ - Parameters
context (QgsRenderContext) –
-
drawSource
()¶
-
fixQPictureDpi
()¶
-
imageOffset
()¶
-
opacity
(self) → float¶ Returns the opacity for the effect.
- Return type
float
- Returns
opacity value between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque
See also
-
properties
(self) → Dict[str, str]¶ - Return type
Dict[str, str]
-
ramp
(self) → QgsColorRamp¶ Returns the color ramp used for the glow. This only applies if the colorType() is set to ColorRamp. The glow will utilize colors from the ramp.
- Return type
- Returns
color ramp for glow
See also
See also
-
readProperties
(self, props: Dict[str, str])¶ - Parameters
props (Dict[str) –
-
setBlendMode
(self, mode: QPainter.CompositionMode)¶ Sets the blend mode for the effect
- Parameters
mode (QPainter.CompositionMode) – blend mode used for drawing the effect on to a destination paint device
See also
-
setBlurLevel
(self, level: float)¶ Sets blur level (radius) for the glow. This can be used to smooth the output from the glow effect.
- Parameters
level (float) – blur level.
See also
See also
See also
-
setBlurMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit scale used for the glow blur strength (radius).
- Parameters
scale (QgsMapUnitScale) – map unit scale for blur strength
See also
See also
See also
New in version 3.4.9.
-
setBlurUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the units used for the glow blur level (radius).
- Parameters
unit (QgsUnitTypes.RenderUnit) – units for blur level
See also
See also
See also
New in version 3.4.9.
-
setColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the color for the glow. This only applies if the colorType() is set to SingleColor. The glow will fade between the specified color and a totally transparent version of the color.
- Parameters
color (Union[QColor) – glow color
See also
See also
-
setColorType
(self, colorType: QgsGlowEffect.GlowColorType)¶ Sets the color mode to use for the glow. The glow can either be drawn using a
QgsColorRamp
color ramp or by simply specificing a single color. setColorType is used to specify which mode to use for the glow.- Parameters
colorType (QgsGlowEffect.GlowColorType) – color type to use for glow
See also
See also
See also
-
setOpacity
(self, opacity: float)¶ Sets the
opacity
for the effect.- Parameters
opacity (float) – double between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque
See also
-
setRamp
(self, ramp: QgsColorRamp)¶ Sets the color ramp for the glow. This only applies if the colorType() is set to ColorRamp. The glow will utilize colors from the ramp.
- Parameters
ramp (QgsColorRamp) – color ramp for glow. Ownership of the ramp is transferred to the effect.
See also
See also
-
setSpread
(self, spread: float)¶ Sets the spread distance for drawing the glow effect.
- Parameters
spread (float) – spread distance. Units are specified via setSpreadUnit()
See also
See also
See also
-
setSpreadMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit scale used for the spread distance.
- Parameters
scale (QgsMapUnitScale) – map unit scale for spread distance
See also
See also
See also
-
setSpreadUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the units used for the glow spread distance.
- Parameters
unit (QgsUnitTypes.RenderUnit) – units for spread distance
See also
See also
See also
-
shadeExterior
(self) → bool¶ Specifies whether the glow is drawn outside the picture or within the picture.
- Return type
bool
- Returns
true if glow is to be drawn outside the picture, or false to draw glow within the picture
-
source
()¶
-
sourceAsImage
()¶
-
spread
(self) → float¶ Returns the spread distance used for drawing the glow effect.
- Return type
float
- Returns
spread distance. Units are retrieved via spreadUnit()
See also
See also
See also
-
spreadMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale used for the spread distance.
- Return type
- Returns
map unit scale for spread distance
See also
See also
See also
-
spreadUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units used for the glow spread distance.
- Return type
- Returns
units for spread distance
See also
See also
See also