Subgroup: Layout

Class: QgsLayoutRuler

class qgis.gui.QgsLayoutRuler(parent: QWidget = None, orientation: Qt.Orientation = Qt.Horizontal)

Bases: PyQt5.QtWidgets.QWidget

Constructor for QgsLayoutRuler, with the specified parent widget and orientation.

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: Methods

actionEvent
changeEvent
childEvent
closeEvent
connectNotify
contextMenuEvent
create
customEvent
destroy
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
enterEvent
event
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPreviousChild
hideEvent
initPainter
inputMethodEvent
isSignalConnected
keyPressEvent
keyReleaseEvent
layoutView Returns the current layout view associated with the ruler.
leaveEvent
metric
minimumSizeHint
mouseDoubleClickEvent
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
moveEvent
nativeEvent
paintEvent
receivers
resizeEvent
rulerSize Returns the ruler size (either the height of a horizontal ruler or the width of a vertical rule).
sender
senderSignalIndex
setContextMenu Sets a context menu to show when right clicking occurs on the ruler.
setCursorPosition Updates the position of the marker showing the current mouse position within the view.
setLayoutView Sets the current layout view to synchronize the ruler with.
setSceneTransform Sets the current scene transform.
sharedPainter
showEvent
tabletEvent
timerEvent
updateMicroFocus
wheelEvent

Signals

cursorPosChanged Is emitted when mouse cursor coordinates change [signal]

Attributes

actionEvent()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
cursorPosChanged

Is emitted when mouse cursor coordinates change [signal]

customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
layoutView(self) → QgsLayoutView

Returns the current layout view associated with the ruler.

See also

setLayoutView()

leaveEvent()
metric()
minimumSizeHint(self) → QSize
mouseDoubleClickEvent()
mouseMoveEvent(self, event: QMouseEvent)
mousePressEvent(self, event: QMouseEvent)
mouseReleaseEvent(self, event: QMouseEvent)
moveEvent()
nativeEvent()
paintEvent(self, event: QPaintEvent)
receivers()
resizeEvent()
rulerSize(self) → int

Returns the ruler size (either the height of a horizontal ruler or the width of a vertical rule).

sender()
senderSignalIndex()
setContextMenu(self, menu: QMenu)

Sets a context menu to show when right clicking occurs on the ruler. Ownership of menu is unchanged.

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.

setLayoutView(self, view: QgsLayoutView)

Sets the current layout view to synchronize the ruler with.

See also

layoutView()

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.

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()