Subgroup: Effect
Class: QgsEffectStack¶
-
class
qgis.core.
QgsEffectStack
¶ Bases:
qgis._core.QgsPaintEffect
A paint effect which consists of a stack of other chained paint effects
Effect stacks can be used to apply multiple paint effects to a QPicture. For instance, an effect stack may blur then apply a drop shadow.
The way in which effects apply to a stack is controlled by the effect’s drawMode. Effects can either render their results onto the destination paint device, or just modify the source picture which is drawn by subsequent effects in the stack. For instance, a blur effect with a Modifier drawMode will blur the source picture for the following drop shadow effect without actually drawing the blurred picture to the paint device. If the blur effect had a Render drawMode then the blurred picture will be drawn on the paint device, but the following drop shadow effect will be drawn using the original picture, not the blurred version.
New in version 2.9: Methods
appendEffect
Appends an effect to the end of the stack. begin
Begins intercepting paint operations to a render context. boundingRect
changeEffect
Replaces the effect at a specified position within the stack. clone
count
Returns count of effects contained by the stack create
Creates a new QgsEffectStack effect. draw
drawMode
Returns the draw mode for the effect. drawSource
effect
Returns a pointer to the effect at a specified index within the stack effectList
Returns a pointer to the list of effects currently contained by enabled
Returns whether the effect is enabled end
Ends interception of paint operations to a render context, and draws the result to the render context after being modified by the effect. fixQPictureDpi
imageOffset
insertEffect
Inserts an effect at a specified index within the stack. properties
Unused for QgsEffectStack, will always return an empty string map readProperties
readProperties(self, props: Dict[str, str]) render
Renders a picture using the effect. saveProperties
setDrawMode
Sets the draw mode for the effect. setEnabled
Sets whether the effect is enabled source
sourceAsImage
takeEffect
Removes an effect from the stack and returns a pointer to it. type
Attributes
Modifier
ModifyAndRender
Render
-
appendEffect
(self, effect: QgsPaintEffect)¶ Appends an effect to the end of the stack.
Parameters: effect – QgsPaintEffect to append. Ownership of the effect will be transferred to the stack object.
See also
-
boundingRect
()¶
-
changeEffect
(self, index: int, effect: QgsPaintEffect) → bool¶ Replaces the effect at a specified position within the stack.
Parameters: - index – position of effect to replace
- effect – QgsPaintEffect to replace with. Ownership of the effect will be
transferred to the stack object.
-
clone
(self) → QgsEffectStack¶
-
count
(self) → int¶ Returns count of effects contained by the stack
Returns: count of effects
-
create
(map: Dict[str, str]) → QgsPaintEffect¶ Creates a new QgsEffectStack effect. This method ignores the map parameter, and always returns an empty effect stack.
Parameters: map – unused encoded properties string map Returns: new QgsEffectStack
-
draw
(self, context: QgsRenderContext)¶
-
drawSource
()¶
-
effect
(self, index: int) → QgsPaintEffect¶ Returns a pointer to the effect at a specified index within the stack
Parameters: index – position of effect to return Returns: QgsPaintEffect at specified position
-
effectList
(self) → object¶ Returns a pointer to the list of effects currently contained by the stack
Returns: list of QgsPaintEffects within the stack
-
fixQPictureDpi
()¶
-
imageOffset
()¶
-
insertEffect
(self, index: int, effect: QgsPaintEffect) → bool¶ Inserts an effect at a specified index within the stack.
Parameters: - index – position to insert the effect
- effect – QgsPaintEffect to insert. Ownership of the effect will be
transferred to the stack object.
See also
-
properties
(self) → Dict[str, str]¶ Unused for QgsEffectStack, will always return an empty string map
-
readProperties
(self, element: QDomElement) → bool¶ readProperties(self, props: Dict[str, str]) Unused for QgsEffectStack, props parameter will be ignored
-
saveProperties
(self, doc: QDomDocument, element: QDomElement) → bool¶
-
source
()¶
-
sourceAsImage
()¶
-
takeEffect
(self, index: int) → QgsPaintEffect¶ Removes an effect from the stack and returns a pointer to it.
Parameters: index – position of effect to take
-
type
(self) → str¶
-