QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
32class GUI_EXPORT QgsPlotToolTemporaryKeyPan : public QgsPlotTool
33{
34 Q_OBJECT
35
36 public:
41
42 void plotMoveEvent( QgsPlotMouseEvent *event ) override;
43 void keyReleaseEvent( QKeyEvent *event ) override;
44 void activate() override;
45
46 private:
47 QPoint mLastMousePos;
48 QPointer<QgsPlotTool> mPreviousTool;
49};
50
57{
58 Q_OBJECT
59
60 public:
65
66 void plotMoveEvent( QgsPlotMouseEvent *event ) override;
67 void plotReleaseEvent( QgsPlotMouseEvent *event ) override;
68 void activate() override;
69
70 private:
71 QPoint mLastMousePos;
72 QPointer<QgsPlotTool> mPreviousTool;
73};
74
81{
82 Q_OBJECT
83
84 public:
89
90 void plotReleaseEvent( QgsPlotMouseEvent *event ) override;
91 void keyPressEvent( QKeyEvent *event ) override;
92 void keyReleaseEvent( QKeyEvent *event ) override;
93 void activate() override;
94
95 private:
96 QPointer<QgsPlotTool> mPreviousViewTool;
97
98 bool mDeactivateOnMouseRelease = false;
99
100 void updateCursor( Qt::KeyboardModifiers modifiers );
101};
102
103#endif // QGSPLOTTRANSIENTTOOLS_H
Plot canvas is a class for displaying interactive 2d charts and plots.
A QgsPlotMouseEvent is the result of a user interaction with the mouse on a QgsPlotCanvas.
Plot tool for temporarily panning a plot while a key is depressed.
Plot tool for temporarily zooming a plot while a key is depressed.
Plot tool for temporarily panning a plot while a mouse button is depressed.
Plot tool for zooming into and out of the plot.
Abstract base class for all interactive plot tools.
Definition qgsplottool.h:58
virtual void plotMoveEvent(QgsPlotMouseEvent *event)
Mouse move event for overriding.
virtual void activate()
Called when the tool is set as the currently active plot tool.
virtual void keyReleaseEvent(QKeyEvent *event)
Key release event for overriding.
virtual void keyPressEvent(QKeyEvent *event)
Key press event for overriding.
virtual void plotReleaseEvent(QgsPlotMouseEvent *event)
Mouse release event for overriding.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53