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

相关推荐
wfsm4 分钟前
mysql事务
数据库·mysql
wangchunting10 分钟前
Jvm-垃圾收集器
java·开发语言·jvm
SadSunset13 分钟前
第一章:Redis 入门介绍
数据库·redis·缓存
weixin_4643076320 分钟前
QT智能指针
java·数据库·qt
架构师沉默23 分钟前
程序员如何避免猝死?
java·后端·架构
Zzxy43 分钟前
快速搭建SpringBoot项目并整合MyBatis-Plus
java·spring boot
星如雨グッ!(๑•̀ㅂ•́)و✧1 小时前
WebFlux onErrorContinue 和 onErrorResume使用详解
java·人工智能
王仲肖1 小时前
PostgreSQL VACUUM 与 AUTOVACUUM 深度解析
数据库·postgresql
电商API&Tina1 小时前
电商数据采集API接口||合规优先、稳定高效、数据精准
java·javascript·数据库·python·json
code_计梦星河1 小时前
Qt 开发第八天:双 TableView 实现规划板块增改功能
qt