QGIS API Documentation
3.6.0-Noosa (5873452)
|
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. More... | |
Signals | |
void | cursorPosChanged (QPointF) |
Is emitted when mouse cursor coordinates change. More... | |
Public Member Functions | |
QgsLayoutRuler (QWidget *parent=nullptr, Qt::Orientation orientation=Qt::Horizontal) | |
Constructor for QgsLayoutRuler, with the specified parent widget and orientation. More... | |
QgsLayoutView * | layoutView () |
Returns the current layout view associated with the ruler. More... | |
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). More... | |
void | setContextMenu (QMenu *menu) |
Sets a context menu to show when right clicking occurs on the ruler. More... | |
void | setLayoutView (QgsLayoutView *view) |
Sets the current layout view to synchronize the ruler with. More... | |
void | setSceneTransform (const QTransform &transform) |
Sets the current scene transform. More... | |
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 38 of file qgslayoutruler.h.
|
explicit |
Constructor for QgsLayoutRuler, with the specified parent widget and orientation.
Definition at line 33 of file qgslayoutruler.cpp.
|
signal |
Is emitted when mouse cursor coordinates change.
|
inline |
Returns the current layout view associated with the ruler.
Definition at line 62 of file qgslayoutruler.h.
|
override |
Definition at line 75 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 580 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 685 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 716 of file qgslayoutruler.cpp.
|
overrideprotected |
Definition at line 80 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 74 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 569 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 574 of file qgslayoutruler.cpp.
void QgsLayoutRuler::setLayoutView | ( | QgsLayoutView * | view | ) |
Sets the current layout view to synchronize the ruler with.
Definition at line 563 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 557 of file qgslayoutruler.cpp.