QWT API (中文) 7.0.1
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
24class QWT_EXPORT QwtPlotPanner : public QwtPicker
25{
26 Q_OBJECT
27 QWT_DECLARE_PRIVATE(QwtPlotPanner)
28public:
29 // Constructor
30 explicit QwtPlotPanner(QWidget* canvas);
31 // Destructor
32 virtual ~QwtPlotPanner();
33
34 // Get the canvas widget
35 QWidget* canvas();
36 // Get the canvas widget (const)
37 const QWidget* canvas() const;
38
39 // Get the plot widget
40 QwtPlot* plot();
41 // Get the plot widget (const)
42 const QwtPlot* plot() const;
43
44 // Set the orientations for panning
45 void setOrientations(Qt::Orientations);
46 // Get the orientations for panning
47 Qt::Orientations orientations() const;
48 // Check if an orientation is enabled
49 bool isOrientationEnabled(Qt::Orientation) const;
50
51 // Set the mouse button and modifiers for panning
52 void setMouseButton(Qt::MouseButton button, Qt::KeyboardModifiers modifiers = Qt::NoModifier);
53 // Get the mouse button and modifiers for panning
54 void getMouseButton(Qt::MouseButton& button, Qt::KeyboardModifiers& modifiers) const;
55
56public Q_SLOTS:
57 // Move the canvas by dx, dy
58 void moveCanvas(int dx, int dy);
59
60Q_SIGNALS:
74 void panned(int dx, int dy);
75
76protected:
78 virtual void widgetMousePressEvent(QMouseEvent* mouseEvent) override;
80 virtual void move(const QPoint&) override;
82 virtual bool end(bool ok = true) override;
83
84private:
86 void init();
87};
88#endif // QWT_PLOT_PANNER_H
QwtPicker 在一个部件上提供选择功能
Definition qwt_picker.h:157
virtual void widgetMousePressEvent(QMouseEvent *)
Handle a mouse press event for the observed widget.
Definition qwt_picker.cpp:1163
virtual void move(const QPoint &)
Move the last point of the selection The moved() signal is emitted.
Definition qwt_picker.cpp:1499
virtual bool end(bool ok=true)
Close a selection setting the state to inactive.
Definition qwt_picker.cpp:1436
QwtPlotPanner 提供绘图画布的平移功能
Definition qwt_plot_panner.h:25
void panned(int dx, int dy)
画布平移后发出的信号
二维绘图部件
Definition qwt_plot.h:138