参考博客:https://www.cnblogs.com/yingjiehit/p/3988701.html
画出的图
改良版的图形,最后的源码见:https://download.csdn.net/download/littlehero_121/11484886
注意:qcustomplot的实现步骤:
1、新建widget项目,然后在Pro文件中加入:
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport(就是直接加上printsupport)
2、加上头文件:
#include "qcustomplot.h"
#include <qmath.h>
#include <QTimer>
#include <qcustomplot.h>
#include <QString>
#include <QTime>
#include <QVector>
3、就是直接在ui中拖入widget控件,并且将右击进行提升,提升为QCustomPlot类
4、将qcustomplot的.h和.cpp文件进行加入进来,直接右击头文件-添加现有文件,或者
右击源文件进行添加-添加现有文件
这样环境基本配置完成,下面就是直接画图了