QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsplottransienttools.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsplottransienttools.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 QGSPLOTTRANSIENTTOOLS_H
19 #define QGSPLOTTRANSIENTTOOLS_H
20 
21 #include "qgsplottool.h"
22 #include "qgis_gui.h"
23 #include "qgis_sip.h"
24 #include "qgsplottoolzoom.h"
25 
32 class GUI_EXPORT QgsPlotToolTemporaryKeyPan : public QgsPlotTool
33 {
34 
35  Q_OBJECT
36 
37  public:
38 
43 
44  void plotMoveEvent( QgsPlotMouseEvent *event ) override;
45  void keyReleaseEvent( QKeyEvent *event ) override;
46  void activate() override;
47 
48  private:
49 
50  QPoint mLastMousePos;
51  QPointer< QgsPlotTool > mPreviousTool;
52 
53 };
54 
60 class GUI_EXPORT QgsPlotToolTemporaryMousePan : public QgsPlotTool
61 {
62 
63  Q_OBJECT
64 
65  public:
66 
71 
72  void plotMoveEvent( QgsPlotMouseEvent *event ) override;
73  void plotReleaseEvent( QgsPlotMouseEvent *event ) override;
74  void activate() override;
75 
76  private:
77 
78  QPoint mLastMousePos;
79  QPointer< QgsPlotTool > mPreviousTool;
80 
81 };
82 
89 {
90 
91  Q_OBJECT
92 
93  public:
94 
99 
100  void plotReleaseEvent( QgsPlotMouseEvent *event ) override;
101  void keyPressEvent( QKeyEvent *event ) override;
102  void keyReleaseEvent( QKeyEvent *event ) override;
103  void activate() override;
104 
105  private:
106 
107  QPointer< QgsPlotTool > mPreviousViewTool;
108 
109  bool mDeactivateOnMouseRelease = false;
110 
111  void updateCursor( Qt::KeyboardModifiers modifiers );
112 };
113 
114 #endif // QGSPLOTTRANSIENTTOOLS_H
QgsPlotTool::plotMoveEvent
virtual void plotMoveEvent(QgsPlotMouseEvent *event)
Mouse move event for overriding.
Definition: qgsplottool.cpp:102
qgsplottoolzoom.h
QgsPlotToolTemporaryKeyZoom
Plot tool for temporarily zooming a plot while a key is depressed.
Definition: qgsplottransienttools.h:88
QgsPlotToolZoom::plotReleaseEvent
void plotReleaseEvent(QgsPlotMouseEvent *event) override
Mouse release event for overriding.
Definition: qgsplottoolzoom.cpp:71
QgsPlotToolZoom::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Key press event for overriding.
Definition: qgsplottoolzoom.cpp:94
QgsPlotTool::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *event)
Key release event for overriding.
Definition: qgsplottool.cpp:132
QgsPlotToolTemporaryKeyPan
Plot tool for temporarily panning a plot while a key is depressed.
Definition: qgsplottransienttools.h:32
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::activate
virtual void activate()
Called when the tool is set as the currently active plot tool.
Definition: qgsplottool.cpp:79
QgsPlotToolZoom::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *event) override
Key release event for overriding.
Definition: qgsplottoolzoom.cpp:107
QgsPlotToolZoom
Plot tool for zooming into and out of the plot.
Definition: qgsplottoolzoom.h:34
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
QgsPlotToolTemporaryMousePan
Plot tool for temporarily panning a plot while a mouse button is depressed.
Definition: qgsplottransienttools.h:60
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53