QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
22#include "qgis_sip.h"
23#include "qgsplottool.h"
24
31class GUI_EXPORT QgsPlotToolPan : public QgsPlotTool
32{
33 Q_OBJECT
34
35 public:
36
41
42 Qgis::PlotToolFlags flags() const override;
43 void plotMoveEvent( QgsPlotMouseEvent *event ) override;
44 void plotPressEvent( QgsPlotMouseEvent *event ) override;
45 void plotReleaseEvent( QgsPlotMouseEvent *event ) override;
46 void deactivate() override;
47
48 private:
49 bool mIsPanning = false;
50 QPoint mLastMousePos;
52 QPoint mMousePressStartPos;
53};
54
55#endif // QGSPLOTTOOLPAN_H
QFlags< PlotToolFlag > PlotToolFlags
Definition qgis.h:4112
Plot canvas is a class for displaying interactive 2d charts and plots.
A mouse event which is the result of a user interaction with a QgsPlotCanvas.
QgsPlotToolPan(QgsPlotCanvas *canvas)
Constructor for QgsPlotToolPan, with the associated canvas.
QgsPlotCanvas * canvas() const
Returns the tool's plot canvas.
virtual void deactivate()
Called when the tool is being deactivated.
QgsPlotTool(QgsPlotCanvas *canvas, const QString &name)
Constructor takes a plot canvas as a parameter.
virtual void plotMoveEvent(QgsPlotMouseEvent *event)
Mouse move event for overriding.
virtual void plotPressEvent(QgsPlotMouseEvent *event)
Mouse press event for overriding.
virtual void plotReleaseEvent(QgsPlotMouseEvent *event)
Mouse release event for overriding.
virtual Qgis::PlotToolFlags flags() const
Returns the flags for the plot tool.