Class: QgsLayoutItemPolyline

class qgis.core.QgsLayoutItemPolyline(layout: QgsLayout)

Bases: QgsLayoutNodesItem

Constructor for QgsLayoutItemPolyline for the specified layout.

QgsLayoutItemPolyline(polyline: QPolygonF, layout: QgsLayout) Constructor for QgsLayoutItemPolyline for the specified polyline and layout.

Layout item for node based polyline shapes.

New in version 3.0.

Parameters

layout

ArrowHead = 1
class MarkerMode

Bases: int

NoMarker = 0
SvgMarker = 2
adjustPointForReferencePosition()
applyDataDefinedSize()
applyItemSizeConstraint()
arrowHeadFillColor(self) → QColor

Returns the color used to fill the arrow head.

Return type

QColor

arrowHeadStrokeColor(self) → QColor

Returns the color used to draw the stroke around the the arrow head.

Return type

QColor

arrowHeadStrokeWidth(self) → float

Returns the pen width in millimeters for the stroke of the arrow head.

Return type

float

arrowHeadWidth(self) → float

Returns the width of line arrow heads in mm.

Return type

float

childEvent()
computeDistance()
connectNotify()
contextMenuEvent()
create(layout: QgsLayout) → QgsLayoutItemPolyline

Returns a new polyline item for the specified layout.

The caller takes responsibility for deleting the returned object.

Parameters

layout (QgsLayout) –

Return type

QgsLayoutItemPolyline

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

str

dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
draw()
drawBackground()
drawDebugRect()
drawFrame()
dropEvent()
endMarker(self) → QgsLayoutItemPolyline.MarkerMode

Returns the end marker mode, which controls what marker is drawn at the end of the line.

See also

setEndMarker()

See also

startMarker()

Return type

QgsLayoutItemPolyline.MarkerMode

endSvgMarkerPath(self) → str

Returns the path the an SVG marker drawn at the end of the line.

Return type

str

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()
rescaleToFitBoundingBox()
sceneEvent()
sceneEventFilter()
sender()
senderSignalIndex()
setArrowHeadFillColor(self, color: Union[QColor, Qt.GlobalColor])

Sets the color used to fill the arrow head.

Parameters

color (Union[QColor) –

setArrowHeadStrokeColor(self, color: Union[QColor, Qt.GlobalColor])

Sets the color used to draw the stroke around the arrow head.

Parameters

color (Union[QColor) –

setArrowHeadStrokeWidth(self, width: float)

Sets the pen width in millimeters for the stroke of the arrow head

Parameters

width (float) –

setArrowHeadWidth(self, width: float)

Sets the width of line arrow heads in mm.

See also

arrowHeadWidth()

Parameters

width (float) –

setEndMarker(self, mode: QgsLayoutItemPolyline.MarkerMode)

Sets the end marker mode, which controls what marker is drawn at the end of the line.

See also

endMarker()

See also

setStartMarker()

Parameters

mode (QgsLayoutItemPolyline.MarkerMode) –

setEndSvgMarkerPath(self, path: str)

Sets the path to a SVG marker to draw at the end of the line.

Parameters

path (str) –

setFixedSize()
setMinimumSize()
setStartMarker(self, mode: QgsLayoutItemPolyline.MarkerMode)

Sets the start marker mode, which controls what marker is drawn at the start of the line.

See also

startMarker()

See also

setEndMarker()

Parameters

mode (QgsLayoutItemPolyline.MarkerMode) –

setStartSvgMarkerPath(self, path: str)

Sets the path to a SVG marker to draw at the start of the line.

Parameters

path (str) –

setSymbol(self, symbol: QgsLineSymbol)

Sets the symbol used to draw the shape. Ownership of symbol is not transferred.

See also

symbol()

Parameters

symbol (QgsLineSymbol) –

shape(self) → QPainterPath
Return type

QPainterPath

startMarker(self) → QgsLayoutItemPolyline.MarkerMode

Returns the start marker mode, which controls what marker is drawn at the start of the line.

See also

setStartMarker()

See also

endMarker()

Return type

QgsLayoutItemPolyline.MarkerMode

startSvgMarkerPath(self) → str

Returns the path the an SVG marker drawn at the start of the line.

Return type

str

symbol(self) → QgsLineSymbol

Returns the line symbol used to draw the shape.

See also

setSymbol()

Return type

QgsLineSymbol

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

int

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

bool