QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_scale_event_dispatcher.h
1#ifndef QWTPLOTSCALEEVENTDISPATCHER_H
2#define QWTPLOTSCALEEVENTDISPATCHER_H
3#include <QObject>
4#include "qwt_global.h"
5#include "qwt_axis_id.h"
6class QMouseEvent;
7class QWheelEvent;
8class QwtPlot;
33class QWT_EXPORT QwtPlotScaleEventDispatcher : public QObject
34{
35 Q_OBJECT
36 QWT_DECLARE_PRIVATE(QwtPlotScaleEventDispatcher)
37public:
39 explicit QwtPlotScaleEventDispatcher(QwtPlot* plot, QObject* par = nullptr);
43 bool isEnable() const;
45 static QwtAxisId findAxisIdByScaleWidget(const QwtPlot* plot, const QwtScaleWidget* scaleWidget);
46public Q_SLOTS:
48 void updateCache();
50 void setEnable(bool on = true);
51
52protected:
53 virtual bool eventFilter(QObject* obj, QEvent* e) override;
54 // 更新数据
55 void rebuildCache();
56 // 处理各种鼠标事件
57 virtual bool handleMousePress(QwtPlot* bindPlot, QMouseEvent* e);
58 virtual bool handleMouseMove(QwtPlot* bindPlot, QMouseEvent* e);
59 virtual bool handleMouseRelease(QwtPlot* bindPlot, QMouseEvent* e);
60 virtual bool handleWheelEvent(QwtPlot* bindPlot, QWheelEvent* e);
61 // 查找应该处理事件的 scale widget
62 QwtScaleWidget* findTargetOnScale(const QPoint& pos);
63};
64
65#endif // QWTPLOTSCALEEVENTDISPATCHER_H
针对寄生绘图的事件过滤器,主要处理坐标轴动作
Definition qwt_plot_scale_event_dispatcher.h:34
~QwtPlotScaleEventDispatcher()
Destructor
二维绘图部件
Definition qwt_plot.h:138
包含刻度的控件
Definition qwt_scale_widget.h:95