53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
#ifndef PST_CURVE2DPLOTOR_H
|
|
#define PST_CURVE2DPLOTOR_H
|
|
|
|
#include "qcustomplot.h"
|
|
|
|
namespace pst
|
|
{
|
|
class Curve2DPlotor :public QCustomPlot
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit Curve2DPlotor(QWidget* parent = nullptr);
|
|
|
|
public:
|
|
void setXAxisTitleName(const QString& titleName);
|
|
void setXAxisFontFamily(const QString& family);
|
|
void setXAxisFontSize(int size);
|
|
void setXAxisRangeMin(double min);
|
|
void setXAxisRangeMax(double max);
|
|
void setXAxisRangeStep(double step);
|
|
|
|
void setYAxisTitleName(const QString& titleName);
|
|
void setYAxisFontFamily(const QString& family);
|
|
void setYAxisFontSize(int size);
|
|
void setYAxisRangeMin(double min);
|
|
void setYAxisRangeMax(double max);
|
|
void setYAxisRangeStep(double step);
|
|
|
|
private slots:
|
|
/// @brief 双击修改标题名称
|
|
void titleDoubleClick(QMouseEvent* event);
|
|
/// @brief 双击修改轴名称
|
|
void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
|
|
/// @brief 双击修改图例名称
|
|
void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
|
|
void selectionChanged();
|
|
void mousePress();
|
|
void mouseWheel();
|
|
/// @brief 随机添加图形
|
|
void addRandomGraph();
|
|
/// @brief 移除选中的图形
|
|
void removeSelectedGraph();
|
|
/// @brief 移除所有图形
|
|
void removeAllGraphs();
|
|
/// @brief 右键菜单
|
|
void contextMenuRequest(QPoint pos);
|
|
/// @brief 移动图例
|
|
void moveLegend();
|
|
/// @brief 图形点击
|
|
void graphClicked(QCPAbstractPlottable* plottable, int dataIndex);
|
|
};
|
|
}
|
|
#endif |