QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
plot
qgsplotmouseevent.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsplotmouseevent.h
3
---------------
4
begin : March 2022
5
copyright : (C) 2022 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
#ifndef QGSPLOTMOUSEEVENT_H
18
#define QGSPLOTMOUSEEVENT_H
19
20
#include "qgis_gui.h"
21
#include "
qgspointlocator.h
"
22
#include "
qgspointxy.h
"
23
24
#include <QMouseEvent>
25
26
class
QgsPlotCanvas
;
27
39
class
GUI_EXPORT
QgsPlotMouseEvent
:
public
QMouseEvent
40
{
41
#ifdef SIP_RUN
42
SIP_CONVERT_TO_SUBCLASS_CODE
43
if
(
dynamic_cast<
QgsPlotMouseEvent
*
>
( sipCpp ) )
44
sipType = sipType_QgsPlotMouseEvent;
45
else
46
sipType = 0;
47
SIP_END
48
#endif
49
50
public
:
57
QgsPlotMouseEvent
(
QgsPlotCanvas
*canvas, QMouseEvent *event );
58
69
QgsPlotMouseEvent
(
70
QgsPlotCanvas
*canvas, QEvent::Type type, QPoint pos, Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = Qt::NoButton, Qt::KeyboardModifiers modifiers = Qt::NoModifier
71
);
72
78
QgsPoint
mapPoint
()
const
;
79
85
QgsPointXY
snappedPoint
();
86
90
bool
isSnapped
();
91
92
private
:
94
QgsPlotCanvas
*mCanvas =
nullptr
;
95
97
QgsPoint
mMapPoint;
98
99
bool
mHasCachedSnapResult =
false
;
100
QgsPointXY
mSnappedPoint;
101
bool
mIsSnapped =
false
;
102
103
void
snapPoint();
104
};
105
106
#endif
// QGSPLOTMOUSEEVENT_H
QgsPlotCanvas
Plot canvas is a class for displaying interactive 2d charts and plots.
Definition
qgsplotcanvas.h:55
QgsPlotMouseEvent::snappedPoint
QgsPointXY snappedPoint()
Returns the point snapped to the plot, if possible.
Definition
qgsplotmouseevent.cpp:36
QgsPlotMouseEvent::mapPoint
QgsPoint mapPoint() const
Returns the point in map coordinates corresponding to the event.
Definition
qgsplotmouseevent.cpp:31
QgsPlotMouseEvent::isSnapped
bool isSnapped()
Returns true if the point can be snapped to the plot.
Definition
qgsplotmouseevent.cpp:45
QgsPlotMouseEvent::QgsPlotMouseEvent
QgsPlotMouseEvent(QgsPlotCanvas *canvas, QMouseEvent *event)
Creates a new QgsPlotMouseEvent.
Definition
qgsplotmouseevent.cpp:21
QgsPointXY
Represents a 2D point.
Definition
qgspointxy.h:62
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition
qgspoint.h:53
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:203
SIP_END
#define SIP_END
Definition
qgis_sip.h:220
qgspointlocator.h
qgspointxy.h
Generated on
for QGIS API Documentation by
1.17.0