Subgroup: Layout

Class: QgsLayoutGuide

class qgis.core.QgsLayoutGuide(orientation: Qt.Orientation, position: QgsLayoutMeasurement, page: QgsLayoutItemPage)

Bases: PyQt5.QtCore.QObject

Constructor for a new guide with the specified orientation and initial position.

A layout must be set by calling setLayout() before the guide can be used. Adding the guide to a QgsLayoutGuideCollection will automatically set the corresponding layout for you.

Contains the configuration for a single snap guide used by a layout.

New in version 3.0: Methods

childEvent
connectNotify
customEvent
disconnectNotify
isSignalConnected
item Returns the guide’s line item.
layout Returns the layout the guide belongs to.
layoutPosition Returns the guide’s position in absolute layout units.
orientation Returns the guide’s orientation.
page Returns the page the guide is contained within.
position Returns the guide’s position within the page.
receivers
sender
senderSignalIndex
setLayout Sets the layout the guide belongs to.
setLayoutPosition Sets the guide’s position in absolute layout units.
setPage Sets the page the guide is contained within.
setPosition Sets the guide’s position within the page.
timerEvent
update Updates the position of the guide’s line item.

Signals

positionChanged Emitted when the guide’s position is changed.

Attributes

childEvent()
connectNotify()
customEvent()
disconnectNotify()
isSignalConnected()
item(self) → QGraphicsLineItem

Returns the guide’s line item.

layout(self) → QgsLayout

Returns the layout the guide belongs to.

See also

setLayout()

layoutPosition(self) → float

Returns the guide’s position in absolute layout units.

orientation(self) → Qt.Orientation

Returns the guide’s orientation.

page(self) → QgsLayoutItemPage

Returns the page the guide is contained within.

See also

setPage()

position(self) → QgsLayoutMeasurement

Returns the guide’s position within the page.

The position indicates either the horizontal or vertical position of the guide, depending on the guide’s orientation().

See also

setPosition()

positionChanged

Emitted when the guide’s position is changed. [signal]

receivers()
sender()
senderSignalIndex()
setLayout(self, layout: QgsLayout)

Sets the layout the guide belongs to.

Note

Adding the guide to a QgsLayoutGuideCollection will automatically set the corresponding layout for you.

See also

layout()

setLayoutPosition(self, position: float)

Sets the guide’s position in absolute layout units.

See also

layoutPosition()

setPage(self, page: QgsLayoutItemPage)

Sets the page the guide is contained within.

See also

page()

setPosition(self, position: QgsLayoutMeasurement)

Sets the guide’s position within the page.

The position argument indicates either the horizontal or vertical position of the guide, depending on the guide’s orientation().

See also

position()

timerEvent()
update(self)

Updates the position of the guide’s line item.