Class: QgsLayoutItemPolyline

class qgis.core.QgsLayoutItemPolyline

Bases: QgsLayoutNodesItem

Layout item for node based polyline shapes.

New in version 3.0.

QgsLayoutItemPolyline(layout: QgsLayout) Constructor for QgsLayoutItemPolyline for the specified layout.

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

Methods

accept

param visitor

arrowHeadFillColor

Returns the color used to fill the arrow head.

arrowHeadStrokeColor

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

arrowHeadStrokeWidth

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

arrowHeadWidth

Returns the width of line arrow heads in mm.

childEvent

connectNotify

contextMenuEvent

create

Returns a new polyline item for the specified layout.

customEvent

disconnectNotify

displayName

rtype

str

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

endMarker

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

endSvgMarkerPath

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

focusInEvent

focusOutEvent

hoverEnterEvent

hoverLeaveEvent

hoverMoveEvent

icon

rtype

QIcon

inputMethodEvent

inputMethodQuery

isSignalConnected

itemChange

keyPressEvent

keyReleaseEvent

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

prepareGeometryChange

readPropertiesFromElement

param element

receivers

sceneEvent

sceneEventFilter

sender

senderSignalIndex

setArrowHeadFillColor

Sets the color used to fill the arrow head.

setArrowHeadStrokeColor

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

setArrowHeadStrokeWidth

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

setArrowHeadWidth

Sets the width of line arrow heads in mm.

setEndMarker

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

setEndSvgMarkerPath

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

setStartMarker

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

setStartSvgMarkerPath

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

setSymbol

Sets the symbol used to draw the shape.

shape

rtype

QPainterPath

startMarker

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

startSvgMarkerPath

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

symbol

Returns the line symbol used to draw the shape.

timerEvent

type

rtype

int

updateBoundingRect

updateMicroFocus

wheelEvent

writePropertiesToElement

param element

Attributes

ArrowHead

NoMarker

SvgMarker

ArrowHead = 1
class MarkerMode

Bases: int

NoMarker = 0
SvgMarker = 2
accept(self, visitor: QgsStyleEntityVisitorInterface) bool
Parameters

visitor (QgsStyleEntityVisitorInterface) –

Return type

bool

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(self, QChildEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QGraphicsSceneContextMenuEvent)
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(self, QEvent)
disconnectNotify(self, QMetaMethod)
displayName(self) str
Return type

str

dragEnterEvent(self, QGraphicsSceneDragDropEvent)
dragLeaveEvent(self, QGraphicsSceneDragDropEvent)
dragMoveEvent(self, QGraphicsSceneDragDropEvent)
dropEvent(self, QGraphicsSceneDragDropEvent)
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(self, QFocusEvent)
focusOutEvent(self, QFocusEvent)
hoverEnterEvent(self, QGraphicsSceneHoverEvent)
hoverLeaveEvent(self, QGraphicsSceneHoverEvent)
hoverMoveEvent(self, QGraphicsSceneHoverEvent)
icon(self) QIcon
Return type

QIcon

inputMethodEvent(self, QInputMethodEvent)
inputMethodQuery(self, Qt.InputMethodQuery) Any
isSignalConnected(self, QMetaMethod) bool
itemChange(self, QGraphicsItem.GraphicsItemChange, Any) Any
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
mouseDoubleClickEvent(self, QGraphicsSceneMouseEvent)
mouseMoveEvent(self, QGraphicsSceneMouseEvent)
mousePressEvent(self, QGraphicsSceneMouseEvent)
mouseReleaseEvent(self, QGraphicsSceneMouseEvent)
prepareGeometryChange(self)
readPropertiesFromElement(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool
Parameters
Return type

bool

receivers(self, PYQT_SIGNAL) int
sceneEvent(self, QEvent) bool
sceneEventFilter(self, QGraphicsItem, QEvent) bool
sender(self) QObject
senderSignalIndex(self) int
setArrowHeadFillColor(self, color: Union[QColor, Qt.GlobalColor, QGradient])

Sets the color used to fill the arrow head.

Parameters

color (Union[QColor) –

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

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) –

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(self, QTimerEvent)
type(self) int
Return type

int

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

bool