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

相关推荐
无糖冰可乐212 小时前
IDEA多java版本切换
java·ide·intellij-idea
合作小小程序员小小店2 小时前
web开发,在线%超市销售%管理系统,基于idea,html,jsp,java,ssh,sql server数据库。
java·前端·sqlserver·ssh·intellij-idea
brucelee1862 小时前
IntelliJ IDEA 设置 Local History 永久保留
java·ide·intellij-idea
上去我就QWER2 小时前
Qt快捷键“魔法师”:QKeySequence
开发语言·c++·qt
Pluto_CSND4 小时前
Java中的静态代理与动态代理(Proxy.newProxyInstance)
java·开发语言
不光头强4 小时前
Spring框架的事务管理
数据库·spring·oracle
百***46455 小时前
Java进阶-在Ubuntu上部署SpringBoot应用
java·spring boot·ubuntu
serve the people5 小时前
Prompts for Chat Models in LangChain
java·linux·langchain
一叶飘零_sweeeet6 小时前
不止于 API 调用:解锁 Java 工具类设计的三重境界 —— 可复用性、线程安全与性能优化
java·工具类
百***92027 小时前
【MySQL】MySQL库的操作
android·数据库·mysql