新增平滑曲线demo

This commit is contained in:
feiyangqingyun
2021-03-08 09:29:47 +08:00
parent 6282e879b3
commit cd0029a6de
10 changed files with 342 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
#ifndef FRMSMOOTHCURVE_H
#define FRMSMOOTHCURVE_H
#include <QWidget>
#include <QList>
#include <QPointF>
#include <QPainterPath>
namespace Ui {
class frmSmoothCurve;
}
class frmSmoothCurve : public QWidget
{
Q_OBJECT
public:
explicit frmSmoothCurve(QWidget *parent = 0);
~frmSmoothCurve();
protected:
void paintEvent(QPaintEvent *event);
private:
Ui::frmSmoothCurve *ui;
QVector<QPointF> datas; //曲线上的点
QPainterPath smoothCurve; //平滑曲线
QPainterPath smoothCurve2; //直接连接点的非平滑曲线
};
#endif // FRMSMOOTHCURVE_H