QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsplottoolpan.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsplottoolpan.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 
18 #ifndef QGSPLOTTOOLPAN_H
19 #define QGSPLOTTOOLPAN_H
20 
21 #include "qgsplottool.h"
22 #include "qgis_gui.h"
23 #include "qgis_sip.h"
24 
25 
32 class GUI_EXPORT QgsPlotToolPan : public QgsPlotTool
33 {
34 
35  Q_OBJECT
36 
37  public:
38 
42  QgsPlotToolPan( QgsPlotCanvas *canvas );
43 
44  Qgis::PlotToolFlags flags() const override;
45  void plotMoveEvent( QgsPlotMouseEvent *event ) override;
46  void plotPressEvent( QgsPlotMouseEvent *event ) override;
47  void plotReleaseEvent( QgsPlotMouseEvent *event ) override;
48  void deactivate() override;
49 
50  private:
51 
52  bool mIsPanning = false;
53  QPoint mLastMousePos;
55  QPoint mMousePressStartPos;
56 
57 };
58 
59 #endif // QGSPLOTTOOLPAN_H
QgsPlotTool::plotMoveEvent
virtual void plotMoveEvent(QgsPlotMouseEvent *event)
Mouse move event for overriding.
Definition: qgsplottool.cpp:102
QgsPlotTool::deactivate
virtual void deactivate()
Called when the tool is being deactivated.
Definition: qgsplottool.cpp:89
QgsPlotToolPan
Plot tool for panning/zoom/navigating plots.
Definition: qgsplottoolpan.h:32
QgsPlotTool::flags
virtual Qgis::PlotToolFlags flags() const
Returns the flags for the plot tool.
Definition: qgsplottool.cpp:74
qgis_sip.h
QgsPlotTool
Abstract base class for all interactive plot tools.
Definition: qgsplottool.h:57
qgsplottool.h
QgsPlotCanvas
Plot canvas is a class for displaying interactive 2d charts and plots.
Definition: qgsplotcanvas.h:53
QgsPlotTool::plotReleaseEvent
virtual void plotReleaseEvent(QgsPlotMouseEvent *event)
Mouse release event for overriding.
Definition: qgsplottool.cpp:117
QgsPlotMouseEvent
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.
Definition: qgsplotmouseevent.h:39
QgsPlotTool::plotPressEvent
virtual void plotPressEvent(QgsPlotMouseEvent *event)
Mouse press event for overriding.
Definition: qgsplottool.cpp:112