qt painter多个点的曲线
2024-08-25 22:40:07
plot.h
#ifndef PLOT_H
#define PLOT_H
#include<QTimer>
#include <QWidget>
class pathplot : public QWidget
{
Q_OBJECT
public:
explicit pathplot(QWidget *parent = nullptr);
void paintEvent(QPaintEvent *event);
};
#endif // PLOT_H
plot.cpp
# include"circlewidget.h"
#include<QPainter>
#include<QDebug>
#include<math.h> plot::CircleWidget(QWidget *parent):QFrame(parent)
{
m_period = ; //周期
m_grain = ; //粒度
m_radius = ; // 振幅
}
plot::~CircleWidget()
{ }
void pathplot::paintEvent(QPaintEvent *event) {
QPainter painter(this);
QPointF pointf[10];
pen.setWidth(6);
painter.setPen(pen); // 设置画笔
for (int i=0; i<10; ++i)
{
pointf[i].setX(2.0+i*10.0);
pointf[i].setY(130.0);
}
painter.drawPoints(pointf, 10);
}
最新文章
- java之设计模式
- 【初探HTML本相】道之真谛不过自然,html标签脱俗还真
- [LintCode] Parking Lot 停车场问题
- gem install 出现Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org
- 【bzoj1066】[SCOI2007]蜥蜴 网络最大流
- const和readonly差别
- docker-compose.yml 语法说明
- Quick Sort In-place Implementation
- asp.net用Zxing库实现条形码输出
- LSM树存储模型
- 使用InternalsVisibleTo给assembly添加“友元assembly”
- hibernate 报query result offset is not supported
- python基础-----字符编码
- APP开发的基本流程
- SpringBoot thymeleaf模板页面没提示,SpringBoot thymeleaf模板插件安装
- Codeforces 931 C. Laboratory Work
- Java POI 3.17写入、导入EXCEL性能测试
- Jackson(使用注解)
- 【WP8】让TextBox文本支持滑动(Scroll)
- 使用 PyQuery