QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
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
Event filter for parasitic plots, handling axis interactions.
Definition qwt_plot_scale_event_dispatcher.h:34
~QwtPlotScaleEventDispatcher()
Destructor.
A 2-D plotting widget.
Definition qwt_plot.h:138
A Widget which contains a scale.
Definition qwt_scale_widget.h:95