QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
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>
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. | |
QgsLayoutView * | layoutView () |
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 |
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.
|
explicit |
Constructor for QgsLayoutRuler, with the specified parent widget and orientation.
Definition at line 34 of file qgslayoutruler.cpp.
|
signal |
Emitted when mouse cursor coordinates change.
|
inline |
Returns the current layout view associated with the ruler.
Definition at line 60 of file qgslayoutruler.h.
|
override |
Definition at line 74 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 579 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 684 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 719 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 79 of file qgslayoutruler.cpp.
|
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.
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.
|
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.
void QgsLayoutRuler::setLayoutView | ( | QgsLayoutView * | view | ) |
Sets the current layout view to synchronize the ruler with.
Definition at line 562 of file qgslayoutruler.cpp.
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.