qt 画图 持续更新

cpp 复制代码
//    QCustomPlot *customPlot;
    const QVector<double> x = {0, 1, 2, 3, 4, 5};
    const QVector<double> y = {1, 1, 2, 2, 4, 4};
    customPlot = ui->ctp;
    customPlot->setOpenGl(true);
    customPlot->addGraph();
    customPlot->xAxis->setRange(0, 5);
    customPlot->yAxis->setRange(0, 5);
    customPlot->xAxis2->setRange(0, 5);
    customPlot->yAxis2->setRange(0, 5);
    customPlot->xAxis2->setVisible(true);
    customPlot->yAxis2->setVisible(true);
    customPlot->graph(0)->setData(x, y);
    customPlot->legend->setVisible(false);
    customPlot->graph(0)->setLineStyle(QCPGraph::LineStyle::lsLine);  // 设置线性
    //    customPlot->graph(0)->setName("TEST");
    //    customPlot->xAxis->setLabel("x");
    //    customPlot->yAxis->setLabel("y");
    //    customPlot->replot();
//    customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
    customPlot->axisRect(0)->setRangeZoomFactor(0.9, 0.9); // x方向为1.2
    customPlot->setInteractions(QCP::iRangeZoom);

https://www.wenshushu.cn/f/ea09y2n6v8q

https://netcut.cn/1hvhuovht

https://wormhole.app/lXx8k#iose8rYXadDmTS6SjG0lpg

相关推荐
oradh4 分钟前
Oracle数据块内部研究(三)
数据库·oracle
在角落发呆25 分钟前
sql创建备份表全攻略:从 SELECT INTO 到跨机容灾
数据库·windows·sql·自动化·备份
长不大的杨瑞杰29 分钟前
Spring AI 企业级 RAG 实战:检索、重排、结构化输出与提示注入防护
java·人工智能·spring·llm·rag·springai
阿凤2142 分钟前
学习java---流程控制篇
java·开发语言·学习
IT研究室1 小时前
最新计算机毕业设计选题推荐-基于spring boot的房屋交易系统-网站-文档指导-Java-springboot
java·spring boot·课程设计
ShineWinsu1 小时前
对于Qt:QSound的解析
c++·qt·面试·音频·笔试·客户端·qsound
7177771 小时前
支持达梦数据库的 DevOps 平台有哪些:从兼容认证到流水线落地的选型判断
运维·数据库·devops
利威尔xu1 小时前
MySQL 事务隔离级别:脏读幻读分不清,4 档隔离选错并发数据全乱套拖垮对账
数据库·mysql·事务·隔离级别·mvcc
RuoyiOffice1 小时前
Java物联网项目拆解:设备接入之后,数据怎样真正用起来
java·vue.js·spring boot·物联网·iot·企业管理·ruoyi office
瀚高PG实验室1 小时前
hg_sslkeygen.sh生成密钥文件报错
运维·服务器·数据库·postgresql·dba·瀚高数据库