DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAChartAxisRangeBinder.h
1#ifndef DACHARTAXISRANGEBINDER_H
2#define DACHARTAXISRANGEBINDER_H
3#include "DAFigureAPI.h"
4#include <QObject>
5#include <QPointer>
6#include <QMetaObject>
7class QwtPlot;
8namespace DA
9{
13class DAFIGURE_API DAChartAxisRangeBinder : public QObject
14{
15 Q_OBJECT
16 Q_DISABLE_COPY(DAChartAxisRangeBinder)
17public:
18 DAChartAxisRangeBinder(QObject* par = nullptr);
19 DAChartAxisRangeBinder(QwtPlot* source, int sourceAxisid, QwtPlot* follower, int followerAxisid, QObject* par = nullptr);
20 // 设置源绘图和对应坐标轴
21 void setSourceChart(QwtPlot* source, int axisid);
22 QwtPlot* getSourcePlot() const;
23 int getSourceAxis() const;
24 // 设置跟随绘图和对应坐标轴
25 void setFollowerChart(QwtPlot* follower, int axisid);
26 QwtPlot* getFollowerPlot() const;
27 int getFollowerAxis() const;
28 // 绑定
29 bool bind();
30 // 解绑
31 bool unbind();
32 // 是否绑定
33 bool isBinded() const;
34 // 是否立即刷新
35 bool isRplotImmediately() const;
36 void setReplotImmediately(bool v);
37 // 是否有效
38 bool isValid() const;
39 // 是否相等
40 bool isSame(const DAChartAxisRangeBinder& other) const;
41 bool isSame(QwtPlot* source, int sourceAxisid, QwtPlot* follower, int followerAxisid) const;
42 // 重载等号
43 bool operator==(const DAChartAxisRangeBinder& other) const;
44
45protected Q_SLOTS:
46 void onSourcePlotScaleDivChanged();
47
48private:
49 bool m_isBinded { false };
50 QPointer< QwtPlot > m_sourcePlot;
51 QPointer< QwtPlot > m_followerPlot;
52 int m_sourceAxisid { 4 };
53 int m_followerAxisid { 4 };
54 QMetaObject::Connection m_con;
55 bool m_replotImmediately { true };
56};
57}
58
59#endif // DACHARTAXISRANGEBINDER_H
绘图坐标轴绑定器
Definition DAChartAxisRangeBinder.h:14
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44