QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsLayoutRuler Class Reference

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. More...

#include <qgslayoutruler.h>

Inheritance diagram for QgsLayoutRuler:
Inheritance graph
[legend]

Public Slots

void setCursorPosition (QPointF position)
 Updates the position of the marker showing the current mouse position within the view.
 

Signals

void cursorPosChanged (QPointF position)
 Emitted when mouse cursor coordinates change.
 

Public Member Functions

 QgsLayoutRuler (QWidget *parent=nullptr, Qt::Orientation orientation=Qt::Horizontal)
 Constructor for QgsLayoutRuler, with the specified parent widget and orientation.
 
QgsLayoutViewlayoutView ()
 Returns the current layout view associated with the ruler.
 
QSize minimumSizeHint () const override
 
int rulerSize () const
 Returns the ruler size (either the height of a horizontal ruler or the width of a vertical rule).
 
void setContextMenu (QMenu *menu)
 Sets a context menu to show when right clicking occurs on the ruler.
 
void setLayoutView (QgsLayoutView *view)
 Sets the current layout view to synchronize the ruler with.
 
void setSceneTransform (const QTransform &transform)
 Sets the current scene transform.
 

Protected Member Functions

void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 

Detailed Description

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.

Definition at line 37 of file qgslayoutruler.h.

Constructor & Destructor Documentation

◆ QgsLayoutRuler()

QgsLayoutRuler::QgsLayoutRuler ( QWidget *  parent = nullptr,
Qt::Orientation  orientation = Qt::Horizontal 
)
explicit

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

Definition at line 34 of file qgslayoutruler.cpp.

Member Function Documentation

◆ cursorPosChanged

void QgsLayoutRuler::cursorPosChanged ( QPointF  position)
signal

Emitted when mouse cursor coordinates change.

◆ layoutView()

QgsLayoutView * QgsLayoutRuler::layoutView ( )
inline

Returns the current layout view associated with the ruler.

See also
setLayoutView()

Definition at line 60 of file qgslayoutruler.h.

◆ minimumSizeHint()

QSize QgsLayoutRuler::minimumSizeHint ( ) const
override

Definition at line 74 of file qgslayoutruler.cpp.

◆ mouseMoveEvent()

void QgsLayoutRuler::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 579 of file qgslayoutruler.cpp.

◆ mousePressEvent()

void QgsLayoutRuler::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 684 of file qgslayoutruler.cpp.

◆ mouseReleaseEvent()

void QgsLayoutRuler::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 719 of file qgslayoutruler.cpp.

◆ paintEvent()

void QgsLayoutRuler::paintEvent ( QPaintEvent *  event)
overrideprotected

Definition at line 79 of file qgslayoutruler.cpp.

◆ rulerSize()

int QgsLayoutRuler::rulerSize ( ) const
inline

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

Definition at line 72 of file qgslayoutruler.h.

◆ setContextMenu()

void QgsLayoutRuler::setContextMenu ( QMenu *  menu)

Sets a context menu to show when right clicking occurs on the ruler.

Ownership of menu is unchanged.

Definition at line 568 of file qgslayoutruler.cpp.

◆ setCursorPosition

void QgsLayoutRuler::setCursorPosition ( QPointF  position)
slot

Updates the position of the marker showing the current mouse position within the view.

position is in layout coordinates.

Definition at line 573 of file qgslayoutruler.cpp.

◆ setLayoutView()

void QgsLayoutRuler::setLayoutView ( QgsLayoutView view)

Sets the current layout view to synchronize the ruler with.

See also
layoutView()

Definition at line 562 of file qgslayoutruler.cpp.

◆ setSceneTransform()

void QgsLayoutRuler::setSceneTransform ( const QTransform &  transform)

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.

Definition at line 556 of file qgslayoutruler.cpp.


The documentation for this class was generated from the following files: