当前位置: 首页 > wzjs >正文

网站源码怎么用免费b2b

网站源码怎么用,免费b2b,电视直播网站怎么做,做网站需要多少钱一年1.下载并添加qcustomplot.c和qcustomplot.h文件 拖动一个Widget,提升为qcustomplot 成功后是这样的, 改第三行:greaterThan(QT_MAJOR_VERSION, 4): QT widgets printsupport 编译,不报错,出现带坐标轴的界面&#…

1.下载并添加qcustomplot.c和qcustomplot.h文件

在这里插入图片描述
拖动一个Widget,提升为qcustomplot
在这里插入图片描述
在这里插入图片描述
成功后是这样的,
在这里插入图片描述
改第三行:greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport 编译,不报错,出现带坐标轴的界面,成功
在这里插入图片描述

2.生成曲线

mainwindow.h增加定时器等等

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "qcustomplot.h"  // 引入QCustomPlot头文件QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{Q_OBJECTpublic:MainWindow(QWidget *parent = nullptr);~MainWindow();private:Ui::MainWindow *ui;QCustomPlot *customPlot; // 添加QCustomPlot指针QTimer *dataTimer; // 定时器QVector<double> xData, yData; // 数据存储void updatePlot(); // 更新图表的函数
};#endif // MAINWINDOW_H

main函数增加曲线等

#include "mainwindow.h"#include <QApplication>int main(int argc, char *argv[])
{QApplication a(argc, argv);MainWindow w;w.show();return a.exec();
}
void MainWindow::updatePlot()
{// 生成新的数据点static double time = 0;static double signalValue = 0;// 生成新信号值(如正弦波)signalValue = qSin(time);time += 0.1;// 保存数据xData.append(time);yData.append(signalValue);// 更新图表customPlot->graph(0)->setData(xData, yData);customPlot->xAxis->setRange(time, 10, Qt::AlignRight); // X轴范围保持在最新10秒内customPlot->replot(); // 刷新图表
}

mianwindow.c添加曲线属性以及定时器参数等

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QTimer>
#include <QVector>
#include <cmath> // 使用数学函数MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);// 初始化QCustomPlotcustomPlot = new QCustomPlot(this);setCentralWidget(customPlot);// 配置图表customPlot->addGraph();customPlot->graph(0)->setPen(QPen(Qt::blue)); // 设置曲线颜色customPlot->xAxis->setLabel("Time (s)");customPlot->yAxis->setLabel("Signal Value");// 启用自动缩放customPlot->xAxis->setRange(0, 10);customPlot->yAxis->setRange(-1, 1);// 初始化定时器dataTimer = new QTimer(this);connect(dataTimer, &QTimer::timeout, this, &MainWindow::updatePlot);dataTimer->start(100); // 每100毫秒更新一次// 初始化数据xData.clear();yData.clear();
}
MainWindow::~MainWindow()
{delete ui;
}

效果:动态正选曲线
在这里插入图片描述

http://www.dtcms.com/wzjs/313501.html

相关文章:

  • 网站建设公司如何盈利凡客建站
  • 沈阳微营销网站制作免费搜索引擎推广方法有哪些
  • php网站换服务器北京网站推广
  • 深圳网站公司招聘新媒体运营培训课程
  • 电子商务网站建设书籍普通话手抄报文字内容
  • 网站开发需求分析报告百度广告竞价排名
  • php 社交网站模板源码app开发多少钱
  • 做seo的网站有那些网络seo首页
  • 网站开发和商城的科目公司网站建设费用多少
  • 游戏网站开发文档挖掘关键词爱站网
  • 如何解析网站太原seo排名优化公司
  • 北京个人网站制作在线种子资源库
  • 东莞网站建设 烤活鱼sem是什么缩写
  • 大连模板网站制作服务如何自己建立一个网站
  • 做网站那些好黄冈网站推广软件免费下载
  • visual c 网站开发广州百度快速优化排名
  • 留学公司网站怎么做泰安做网站公司
  • 公司做网站费用会计处理竞价代运营公司
  • wordpress降级插件南宁网站seo排名优化
  • 做网站用哪种编程语言提高工作效率的句子
  • 枣庄手机网站开发公司网站设计模板
  • 徐州关键词优化seo查询源码
  • 政府网站建设进展情况外国人b站
  • 做网站前端要会什么网站开发的基本流程
  • 新公司董事长致辞做网站百度推广怎么样才有效果
  • wordpress做定制T恤的网站河南网站排名
  • 360云盘做服务器建设网站seo教程论坛
  • 江门网站建设设计如何在百度上做产品推广
  • 教人做素食的网站网站seo置顶 乐云践新专家
  • 潍坊网站建设网超专业制作网页的公司