Class: QgsLayoutGuide¶
- class qgis.core.QgsLayoutGuide¶
Bases:
PyQt5.QtCore.QObject
Contains the configuration for a single snap guide used by a layout.
New in version 3.0.
QgsLayoutGuide(orientation: Qt.Orientation, position:
QgsLayoutMeasurement
, page:QgsLayoutItemPage
) Constructor for a new guide with the specifiedorientation
and initialposition
.A layout must be set by calling
setLayout()
before the guide can be used. Adding the guide to aQgsLayoutGuideCollection
will automatically set the corresponding layout for you.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
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- item(self) QGraphicsLineItem ¶
Returns the guide’s line item.
- Return type:
QGraphicsLineItem
- layoutPosition(self) float ¶
Returns the guide’s position in absolute layout units.
See also
- Return type:
float
- orientation(self) Qt.Orientation ¶
Returns the guide’s orientation.
- Return type:
Qt.Orientation
- page(self) QgsLayoutItemPage ¶
Returns the page the guide is contained within.
See also
- Return type:
- 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
- Return type:
- positionChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- 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
- Parameters:
layout (QgsLayout) –
- setLayoutPosition(self, position: float)¶
Sets the guide’s
position
in absolute layout units.See also
- Parameters:
position (float) –
- setPage(self, page: QgsLayoutItemPage)¶
Sets the
page
the guide is contained within.See also
- Parameters:
page (QgsLayoutItemPage) –
- 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’sorientation()
.See also
- Parameters:
position (QgsLayoutMeasurement) –
- timerEvent(self, QTimerEvent)¶
- update(self)¶
Updates the position of the guide’s line item.