Class: QgsLayoutGuide¶
Contains the configuration for a single snap guide used by a layout.
Class Hierarchy¶
Base classes¶
Methods
Returns the guide's line item. |
|
Returns the layout the guide belongs to. |
|
Returns the guide's position in absolute layout units. |
|
Returns the guide's orientation. |
|
Returns the page the guide is contained within. |
|
Returns the guide's position within the page. |
|
Sets the layout the guide belongs to. |
|
Sets the guide's position in absolute layout units. |
|
Sets the page the guide is contained within. |
|
Sets the guide's position within the page. |
|
Updates the position of the guide's line item. |
Signals
Emitted when the guide's position is changed. |
- class qgis.core.QgsLayoutGuide[source]¶
Bases:
QObject- __init__(orientation: Qt.Orientation, position: QgsLayoutMeasurement, page: QgsLayoutItemPage | None)
Constructor for a new guide with the specified
orientationand initialposition.A layout must be set by calling
setLayout()before the guide can be used. Adding the guide to aQgsLayoutGuideCollectionwill automatically set the corresponding layout for you.- Parameters:
orientation (Qt.Orientation)
position (QgsLayoutMeasurement)
page (Optional[QgsLayoutItemPage])
- item(self) QGraphicsLineItem | None[source]¶
Returns the guide’s line item.
- Return type:
Optional[QGraphicsLineItem]
- layout(self) QgsLayout | None[source]¶
Returns the layout the guide belongs to.
See also
- Return type:
Optional[QgsLayout]
- layoutPosition(self) float[source]¶
Returns the guide’s position in absolute layout units.
See also
- Return type:
float
- orientation(self) Qt.Orientation[source]¶
Returns the guide’s orientation.
- Return type:
Qt.Orientation
- page(self) QgsLayoutItemPage | None[source]¶
Returns the page the guide is contained within.
See also
- Return type:
Optional[QgsLayoutItemPage]
- position(self) QgsLayoutMeasurement[source]¶
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
- Return type:
- setLayout(self, layout: QgsLayout | None)[source]¶
Sets the
layoutthe guide belongs to.Note
Adding the guide to a
QgsLayoutGuideCollectionwill automatically set the corresponding layout for you.See also
- Parameters:
layout (Optional[QgsLayout])
- setLayoutPosition(self, position: float)[source]¶
Sets the guide’s
positionin absolute layout units.See also
- Parameters:
position (float)
- setPage(self, page: QgsLayoutItemPage | None)[source]¶
Sets the
pagethe guide is contained within.See also
- Parameters:
page (Optional[QgsLayoutItemPage])
- setPosition(self, position: QgsLayoutMeasurement)[source]¶
Sets the guide’s
positionwithin the page.The
positionargument indicates either the horizontal or vertical position of the guide, depending on the guide’sorientation().See also
- Parameters:
position (QgsLayoutMeasurement)