QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_panner.h
1#ifndef QWT_PLOT_PANNER_H
2#define QWT_PLOT_PANNER_H
3#include "qwt_global.h"
4#include "qwt_picker.h"
5
6// qt
7class QWidget;
8
9// qwt
10class QwtPlot;
11
17class QWT_EXPORT QwtPlotPanner : public QwtPicker
18{
19 Q_OBJECT
20 QWT_DECLARE_PRIVATE(QwtPlotPanner)
21public:
22 // Constructor
23 explicit QwtPlotPanner(QWidget* canvas);
24 // Destructor
25 ~QwtPlotPanner() override;
26
27 // Get the canvas widget
28 QWidget* canvas();
29 // Get the canvas widget (const)
30 const QWidget* canvas() const;
31
32 // Get the plot widget
33 QwtPlot* plot();
34 // Get the plot widget (const)
35 const QwtPlot* plot() const;
36
37 // Set the orientations for panning
38 void setOrientations(Qt::Orientations);
39 // Get the orientations for panning
40 Qt::Orientations orientations() const;
41 // Check if an orientation is enabled
42 bool isOrientationEnabled(Qt::Orientation) const;
43
44 // Set the mouse button and modifiers for panning
45 void setMouseButton(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
46 // Get the mouse button and modifiers for panning
47 void getMouseButton(Qt::MouseButton& button, Qt::KeyboardModifiers& modifiers) const;
48
49public Q_SLOTS:
50 // Move the canvas by dx, dy
51 void moveCanvas(int dx, int dy);
52
53Q_SIGNALS:
59 void panned(int dx, int dy);
60
61protected:
63 virtual void widgetMousePressEvent(QMouseEvent* mouseEvent) override;
65 virtual void move(const QPoint&) override;
67 virtual bool end(bool ok = true) override;
68
69private:
71 void init();
72};
73#endif // QWT_PLOT_PANNER_H
QwtPicker provides selections on a widget
Definition qwt_picker.h:108
virtual void widgetMousePressEvent(QMouseEvent *)
Handle a mouse press event for the observed widget.
Definition qwt_picker.cpp:905
virtual void move(const QPoint &)
Move the last point of the selection The moved() signal is emitted.
Definition qwt_picker.cpp:1241
virtual bool end(bool ok=true)
Close a selection setting the state to inactive.
Definition qwt_picker.cpp:1178
QwtPlotPanner provides panning of a plot canvas
Definition qwt_plot_panner.h:18
void panned(int dx, int dy)
Signal emitted after the canvas has been panned
A 2-D plotting widget
Definition qwt_plot.h:99