DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DAChartCurveItemSettingWidget.h
1#ifndef DACHARTCURVEITEMSETTINGWIDGET_H
2#define DACHARTCURVEITEMSETTINGWIDGET_H
3#include "DAGuiAPI.h"
4#include <QWidget>
5#include <QPointer>
6#include "DAAbstractChartItemSettingWidget.h"
7#include "qwt_plot_curve.h"
8#include "qwt_symbol.h"
9
10// Qt
11class QAbstractButton;
12// qwt
13class QwtPlot;
14
15namespace Ui
16{
17class DAChartCurveItemSettingWidget;
18}
19
20namespace DA
21{
22class DAChartPlotItemSettingWidget;
29{
30 Q_OBJECT
31
32public:
33 explicit DAChartCurveItemSettingWidget(QWidget* parent = nullptr);
35 // 根据QwtPlotCurve更新ui
36 void updateUI(QwtPlotItem* item) override;
37 // 根据ui更新plotitem
38 void applySetting(QwtPlotCurve* item);
39 // 标题
40 void setTitle(const QString& t);
41 QString getTitle() const;
42 // Curve Style
43 void setCurveStyle(QwtPlotCurve::CurveStyle v);
44 QwtPlotCurve::CurveStyle getCurveStyle() const;
45 // Curve Attribute
46 void setCurveAttribute(QwtPlotCurve::CurveAttribute v);
47 QwtPlotCurve::CurveAttribute getCurveAttribute() const;
48 // Legend Attribute
49 void setLegendAttribute(QwtPlotCurve::LegendAttributes v);
50 QwtPlotCurve::LegendAttributes getLegendAttribute() const;
51 // maker编辑
52 void enableMarkerEdit(bool on = true);
53 bool isEnableMarkerEdit() const;
54 // fill编辑
55 void enableFillEdit(bool on = true);
56 bool isEnableFillEdit() const;
57 // 画笔
58 QPen getCurvePen() const;
59 // 填充
60 QBrush getFillBrush() const;
61 // 基线
62 double getBaseLine() const;
63 bool isHaveBaseLine() const;
64 // 方向
65 void setOrientation(Qt::Orientation v);
66 Qt::Orientation getOrientation() const;
67 // 清空界面
68 void resetUI();
69 // 获取itemplot widget
70 DAChartPlotItemSettingWidget* getItemSettingWidget() const;
71public slots:
72 // 画笔
73 void setCurvePen(const QPen& v);
74 // 填充
75 void setFillBrush(const QBrush& v);
76 // 基线
77 void setBaseLine(double v);
78
79protected:
80 void resetCurveStyleComboBox();
81private slots:
82 void onCurveStyleCurrentIndexChanged(int index);
83 void onCheckBoxFittedClicked(bool checked);
84 void on_checkBoxInverted_clicked(bool checked);
85 void on_checkBoxLegendShowLine_clicked(bool checked);
86 void on_checkBoxLegendShowSymbol_clicked(bool checked);
87 void on_checkBoxLegendShowBrush_clicked(bool checked);
88 void on_checkBoxEnableMarker_clicked(bool checked);
89 void on_checkBoxEnableFill_clicked(bool checked);
90 void onSymbolStyleChanged(QwtSymbol::Style s);
91 void onSymbolSizeChanged(int s);
92 void onSymbolColorChanged(const QColor& s);
93 void onSymbolOutlinePenChanged(const QPen& s);
94 void onBrushChanged(const QBrush& b);
95 void on_lineEditBaseLine_editingFinished();
96 void onButtonGroupOrientationClicked(QAbstractButton* b);
97 void onCurvePenChanged(const QPen& p);
98protected slots:
99 virtual void plotItemAttached(QwtPlotItem* plotItem, bool on);
100
101private:
102 Ui::DAChartCurveItemSettingWidget* ui;
103};
104}
105
106#endif // DACHARTCURVEITEMSETTINGWIDGET_H
chart设置的基类封装了基本操作
Definition DAAbstractChartItemSettingWidget.h:32
曲线设置窗口
Definition DAChartCurveItemSettingWidget.h:29
QwtPlotItem的设置窗口
Definition DAChartPlotItemSettingWidget.h:21
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44