Class: QgsLayoutRuler¶
- class qgis.gui.QgsLayoutRuler¶
Bases:
PyQt5.QtWidgets.QWidget
A custom ruler widget for use with
QgsLayoutView
, displaying the current zoom and position of the visible layout and for interacting with guides in a layout.New in version 3.0.
QgsLayoutRuler(parent: QWidget = None, orientation: Qt.Orientation = Qt.Horizontal) Constructor for
QgsLayoutRuler
, with the specifiedparent
widget andorientation
.Methods
Returns the current layout view associated with the ruler.
- rtype
QSize
- param event
- param event
- param event
- param event
Returns the ruler size (either the height of a horizontal ruler or the width of a vertical rule).
Sets a context
menu
to show when right clicking occurs on the ruler.Updates the
position
of the marker showing the current mouse position within the view.Sets the current layout
view
to synchronize the ruler with.Sets the current scene
transform
.Signals
Emitted when mouse cursor coordinates change [signal]
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- cursorPosChanged¶
Emitted when mouse cursor coordinates change [signal]
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- layoutView(self) QgsLayoutView ¶
Returns the current layout view associated with the ruler.
See also
- Return type
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- minimumSizeHint(self) QSize ¶
- Return type
QSize
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, event: QMouseEvent)¶
- Parameters
event (QMouseEvent) –
- mousePressEvent(self, event: QMouseEvent)¶
- Parameters
event (QMouseEvent) –
- mouseReleaseEvent(self, event: QMouseEvent)¶
- Parameters
event (QMouseEvent) –
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, event: QPaintEvent)¶
- Parameters
event (QPaintEvent) –
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- rulerSize(self) int ¶
Returns the ruler size (either the height of a horizontal ruler or the width of a vertical rule).
- Return type
int
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setContextMenu(self, menu: QMenu)¶
Sets a context
menu
to show when right clicking occurs on the ruler. Ownership ofmenu
is unchanged.- Parameters
menu (QMenu) –
- setCursorPosition(self, position: Union[QPointF, QPoint])¶
Updates the
position
of the marker showing the current mouse position within the view.position
is in layout coordinates.- Parameters
position (Union[QPointF) –
- setLayoutView(self, view: QgsLayoutView)¶
Sets the current layout
view
to synchronize the ruler with.See also
- Parameters
view (QgsLayoutView) –
- setSceneTransform(self, transform: QTransform)¶
Sets the current scene
transform
. This is usually the transform set for a view showing the associated scene, in order to synchronize the view’s display of the scene with the rulers.- Parameters
transform (QTransform) –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶