DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAChartManageWidget.h
1#ifndef DACHARTMANAGEWIDGET_H
2#define DACHARTMANAGEWIDGET_H
3#include "DAGuiAPI.h"
4#include <QWidget>
5#include "DAFigureElementSelection.h"
6#include "qwt_axis_id.h"
7namespace Ui
8{
9class DAChartManageWidget;
10}
11
12// qt
13class QStandardItem;
14// qwt
15class QwtPlot;
16class QwtPlotItem;
17
18namespace DA
19{
20class DAChartOperateWidget;
21class DAFigureWidget;
22class DAFigureTreeView;
23class DAChartWidget;
24class DAChartItemStandardItem;
25class DAChartWidgetStandardItem;
29class DAGUI_API DAChartManageWidget : public QWidget
30{
31 Q_OBJECT
32 DA_DECLARE_PRIVATE(DAChartManageWidget)
33public:
34 DAChartManageWidget(QWidget* parent = nullptr);
36 // 设置绘图操作窗口,只有设置了绘图操作窗口,管理窗口才可以工作
37 void setChartOperateWidget(DAChartOperateWidget* cow);
38 // 设置item点击时如果不是当前chart,设置为当前chart
39 void setCurrentChartOnItemClicked(bool on);
40 bool isSetCurrentChartOnItemClicked() const;
41 // 设置item双击时如果不是当前chart,设置为当前chart
42 void setCurrentChartOnItemDoubleClicked(bool on);
43 bool isSetCurrentChartOnItemDoubleClicked() const;
44 // 通过plot获取figure
45 DAFigureWidget* plotToFigureWidget(QwtPlot* plot) const;
46 // 获取当前的figure
47 DAFigureWidget* getCurrentFigure() const;
48public Q_SLOTS:
49 // 把管理树展开
50 void expandCurrentTree();
51 // 把管理树收起
52 void collapseCurrentTree();
53Q_SIGNALS:
60 void figureElementDbClicked(const DAFigureElementSelection& selection);
66
72
73protected:
74 // 获取当前的tree
75 DAFigureTreeView* currentTreeView() const;
76
77private:
78 // 设置当前显示的fig对应的view
79 void setCurrentDisplayView(DA::DAFigureWidget* fig);
80 DAFigureWidget* getComboboxFigure(int index) const;
81 void setStackCurrentFigure(DA::DAFigureWidget* fig);
82 void setComboboxCurrentFigure(DA::DAFigureWidget* fig);
83private slots:
84 void onFigureCreated(DA::DAFigureWidget* fig);
85 void onFigureCloseing(DA::DAFigureWidget* fig);
86 void onCurrentFigureChanged(DA::DAFigureWidget* fig, int index);
87 // 点击了plotitem,这里要把信号转发出去
88 void onPlotClicked(QwtPlot* plot, QStandardItem* treeItem);
89 void onPlotItemClicked(QwtPlotItem* item, QwtPlot* plot, QStandardItem* treeItem);
90 void onAxisClicked(QwtAxisId axisId, QwtPlot* plot, QStandardItem* treeItem);
91 // 绘图设置窗口点击
92 void onToolButtonFigureSettingClicked();
93 // combobox
94 void onComboboxCurrentIndexChanged(int index);
95
96private:
97 Ui::DAChartManageWidget* ui;
98};
99} // end of namespace DA
100#endif // DACHARTMANAGEWIDGET_H
绘图管理窗口
Definition DAChartManageWidget.h:30
void selectFigureChanged(DA::DAFigureWidget *fig)
当前选中的绘图发生了改变
void figureElementClicked(const DAFigureElementSelection &selection)
绘图元素选中信号
void requestFigureSetting(DA::DAFigureWidget *fig)
请求绘图的设置
绘图操作窗口
Definition DAChartOperateWidget.h:23
用于存放绘图元素
Definition DAFigureElementSelection.h:19
绘图树
Definition DAFigureTreeView.h:19
绘图窗口
Definition DAFigureWidget.h:35
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44