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

相关推荐
float_六七2 小时前
IntelliJ IDEA双击Ctrl的妙用
java·ide·intellij-idea
ajassi20003 小时前
开源 C++ QT Widget 开发(十五)多媒体--音频播放
linux·c++·qt·开源
能摆一天是一天3 小时前
JAVA stream().flatMap()
java·windows
零点零一3 小时前
VS+QT的编程开发工作:关于QT VS tools的使用 qt的官方帮助
开发语言·qt
睡觉的时候不会困3 小时前
Redis 主从复制详解:原理、配置与主从切换实战
数据库·redis·bootstrap
颜如玉4 小时前
🤲🏻🤲🏻🤲🏻临时重定向一定要能重定向🤲🏻🤲🏻🤲🏻
java·http·源码
程序员的世界你不懂5 小时前
【Flask】测试平台开发,新增说明书编写和展示功能 第二十三篇
java·前端·数据库
星空寻流年5 小时前
设计模式第一章(建造者模式)
java·设计模式·建造者模式
自学也学好编程5 小时前
【数据库】Redis详解:内存数据库与缓存之王
数据库·redis
gb42152876 小时前
java中将租户ID包装为JSQLParser的StringValue表达式对象,JSQLParser指的是?
java·开发语言·python