Class: QgsLayoutItemShape

class qgis.core.QgsLayoutItemShape(layout: QgsLayout)

Bases: QgsLayoutItem

Constructor for QgsLayoutItemShape, with the specified parent layout.

Layout item for basic filled shapes (e.g. rectangles, ellipses).

New in version 3.0.

Parameters

layout

Ellipse = 0
Rectangle = 1
class Shape

Bases: int

Triangle = 2
accept(self, visitor: QgsStyleEntityVisitorInterface) → bool
Parameters

visitor (QgsStyleEntityVisitorInterface) –

Return type

bool

adjustPointForReferencePosition()
applyDataDefinedSize()
applyItemSizeConstraint()
boundingRect(self) → QRectF
Return type

QRectF

childEvent()
connectNotify()
contextMenuEvent()
cornerRadius(self) → QgsLayoutMeasurement

Returns the corner radius for rounded rectangle corners.

Return type

QgsLayoutMeasurement

create(layout: QgsLayout) → QgsLayoutItemShape

Returns a new shape item for the specified layout.

The caller takes responsibility for deleting the returned object.

Parameters

layout (QgsLayout) –

Return type

QgsLayoutItemShape

customEvent()
disconnectNotify()
displayName(self) → str
Return type

str

dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
draw(self, context: QgsLayoutItemRenderContext)
Parameters

context (QgsLayoutItemRenderContext) –

drawBackground()
drawDebugRect()
drawFrame()
dropEvent()
estimatedFrameBleed(self) → float
Return type

float

focusInEvent()
focusOutEvent()
hoverEnterEvent()
hoverLeaveEvent()
hoverMoveEvent()
icon(self) → QIcon
Return type

QIcon

inputMethodEvent()
inputMethodQuery()
isSignalConnected()
itemChange()
keyPressEvent()
keyReleaseEvent()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
positionAtReferencePoint()
prepareGeometryChange()
readObjectPropertiesFromElement()
readPropertiesFromElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool
Parameters
Return type

bool

receivers()
refreshBackgroundColor()
refreshBlendMode()
refreshFrame()
refreshItemPosition()
refreshItemRotation()
refreshItemSize()
refreshOpacity()
sceneEvent()
sceneEventFilter()
sender()
senderSignalIndex()
setCornerRadius(self, radius: QgsLayoutMeasurement)

Sets the corner radius for rounded rectangle corners.

See also

cornerRadius()

Parameters

radius (QgsLayoutMeasurement) –

setFixedSize()
setMinimumSize()
setShapeType(self, type: QgsLayoutItemShape.Shape)

Sets the type of shape (e.g. rectangle, ellipse, etc).

See also

shapeType()

Parameters

type (QgsLayoutItemShape.Shape) –

setSymbol(self, symbol: QgsFillSymbol)

Sets the fill symbol used to draw the shape. Ownership is not transferred and a clone of the symbol is made.

See also

symbol()

Parameters

symbol (QgsFillSymbol) –

shapeType(self) → QgsLayoutItemShape.Shape

Returns the type of shape (e.g. rectangle, ellipse, etc).

See also

setShapeType()

Return type

QgsLayoutItemShape.Shape

symbol(self) → QgsFillSymbol

Returns the fill symbol used to draw the shape.

See also

setSymbol()

Return type

QgsFillSymbol

timerEvent()
topLeftToReferencePoint()
type(self) → int
Return type

int

updateMicroFocus()
wheelEvent()
writeObjectPropertiesToElement()
writePropertiesToElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) → bool
Parameters
Return type

bool