Class: QgsLayoutItemShape¶
Layout item for basic filled shapes (e.g. rectangles, ellipses).
Class Hierarchy¶
Base classes¶
Base class for graphical items within a |
|
A base class for objects which belong to a layout. |
|
Abstract interface for generating an expression context. |
|
Interface for layout objects which support undo/redo commands. |
Methods
Returns the corner radius for rounded rectangle corners. |
|
Sets the corner radius for rounded rectangle corners. |
|
Sets the type of shape (e.g. rectangle, ellipse, etc). |
|
Sets the fill symbol used to draw the shape. |
|
Returns the type of shape (e.g. rectangle, ellipse, etc). |
|
Returns the fill symbol used to draw the shape. |
Static Methods
Returns a new shape item for the specified layout. |
Attributes
- class qgis.core.QgsLayoutItemShape[source]¶
Bases:
QgsLayoutItem
- __init__(layout: QgsLayout | None)
Constructor for QgsLayoutItemShape, with the specified parent
layout
.- Parameters:
layout (Optional[QgsLayout])
- Ellipse = 0¶
- Rectangle = 1¶
- class Shape¶
Bases:
int
- Triangle = 2¶
- cornerRadius(self) QgsLayoutMeasurement [source]¶
Returns the corner radius for rounded rectangle corners.
See also
- Return type:
- static create(layout: QgsLayout | None) QgsLayoutItemShape | None [source]¶
Returns a new shape item for the specified
layout
.The caller takes responsibility for deleting the returned object.
- Parameters:
layout (Optional[QgsLayout])
- Return type:
Optional[QgsLayoutItemShape]
- setCornerRadius(self, radius: QgsLayoutMeasurement)[source]¶
Sets the corner
radius
for rounded rectangle corners.See also
- Parameters:
radius (QgsLayoutMeasurement)
- setShapeType(self, type: QgsLayoutItemShape.Shape)[source]¶
Sets the
type
of shape (e.g. rectangle, ellipse, etc).See also
- Parameters:
type (QgsLayoutItemShape.Shape)
- setSymbol(self, symbol: QgsFillSymbol | None)[source]¶
Sets the fill
symbol
used to draw the shape. Ownership is not transferred and a clone of the symbol is made.See also
- Parameters:
symbol (Optional[QgsFillSymbol])
- shapeType(self) QgsLayoutItemShape.Shape [source]¶
Returns the type of shape (e.g. rectangle, ellipse, etc).
See also
- Return type:
- symbol(self) QgsFillSymbol | None [source]¶
Returns the fill symbol used to draw the shape.
See also
- Return type:
Optional[QgsFillSymbol]