QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas. More...
#include <qgsplotmouseevent.h>
Public Member Functions | |
QgsPlotMouseEvent (QgsPlotCanvas *canvas, QEvent::Type type, QPoint pos, Qt::MouseButton button=Qt::NoButton, Qt::MouseButtons buttons=Qt::NoButton, Qt::KeyboardModifiers modifiers=Qt::NoModifier) | |
Creates a new QgsPlotMouseEvent. | |
QgsPlotMouseEvent (QgsPlotCanvas *canvas, QMouseEvent *event) | |
Creates a new QgsPlotMouseEvent. | |
bool | isSnapped () |
Returns true if the point can be snapped to the plot. | |
QgsPoint | mapPoint () const |
Returns the point in map coordinates corresponding to the event. | |
QgsPointXY | snappedPoint () |
Returns the point snapped to the plot, if possible. | |
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.
The event is sent whenever the user moves, clicks, releases or double clicks the mouse.
In addition to the coordinates in pixel space the event may have knowledge about geographic coordinates corresponding to the event.
Definition at line 39 of file qgsplotmouseevent.h.
QgsPlotMouseEvent::QgsPlotMouseEvent | ( | QgsPlotCanvas * | canvas, |
QMouseEvent * | event | ||
) |
Creates a new QgsPlotMouseEvent.
canvas | The map canvas on which the event occurred |
event | The original mouse event |
Definition at line 20 of file qgsplotmouseevent.cpp.
QgsPlotMouseEvent::QgsPlotMouseEvent | ( | QgsPlotCanvas * | canvas, |
QEvent::Type | type, | ||
QPoint | pos, | ||
Qt::MouseButton | button = Qt::NoButton , |
||
Qt::MouseButtons | buttons = Qt::NoButton , |
||
Qt::KeyboardModifiers | modifiers = Qt::NoModifier |
||
) |
Creates a new QgsPlotMouseEvent.
canvas | The canvas on which the event occurred |
type | The type of the event |
pos | The pixel position of the mouse |
button | The pressed button |
buttons | Further buttons that are pressed |
modifiers | Keyboard modifiers |
Definition at line 25 of file qgsplotmouseevent.cpp.
bool QgsPlotMouseEvent::isSnapped | ( | ) |
Returns true
if the point can be snapped to the plot.
Definition at line 47 of file qgsplotmouseevent.cpp.
QgsPoint QgsPlotMouseEvent::mapPoint | ( | ) | const |
Returns the point in map coordinates corresponding to the event.
May return an empty point if the event cannot be converted to a map point.
Definition at line 33 of file qgsplotmouseevent.cpp.
QgsPointXY QgsPlotMouseEvent::snappedPoint | ( | ) |
Returns the point snapped to the plot, if possible.
Returns the original canvas point if snapping was not possible.
Definition at line 38 of file qgsplotmouseevent.cpp.