美文网首页
QCustomPlot 常用方法

QCustomPlot 常用方法

作者: hanabic | 来源:发表于2019-12-25 07:14 被阅读0次

1、导入QT Creator 方法

将qcustomplot.h文件与.qcustomplotc文件放入文件夹并导入QT += printsupport

之后再打开设计器,加入一个widget,选择右键提升为


现在可在主窗口相关文件内通过UI 对象,对QCustomPlot进行操作。

常用操作

设置坐标范围

mPlot->xAxis->setRange(-6.0, 6.0);
mPlot->yAxis->setRange(0, 12.0);
mPlot->addGraph(mPlot->yAxis, mPlot->xAxis);

设置画笔

drawPen.setColor(Qt::gray);
drawPen.setWidth(1);
drawPen.setStyle(Qt::DashLine);
mPlot->graph(0)->setPen(drawPen);

相关文章

网友评论

      本文标题:QCustomPlot 常用方法

      本文链接:https://www.haomeiwen.com/subject/msgfyctx.html