- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 QCustomPlot 的新手,想开始第一个关于基本用法的 QCustomPlot 示例。在下面的代码中:我总是有一个断点,它在程序即将调试时停止程序(没有错误并且构建成功完成)
QCustomPlot *customPlot;
QVector<double> x(101), y(101);
for (int i=0; i<101; ++i) {
x[i] = i/50.0 - 1; // x goes from -1 to 1
y[i] = x[i]*x[i]; // let's plot a quadratic function
}
customPlot->addGraph();
customPlot->graph(0)->setData(x, y);
customPlot->xAxis->setLabel("x");
customPlot->yAxis->setLabel("y");
customPlot->xAxis->setRange(-1, 1);
customPlot->yAxis->setRange(0, 1);
customPlot->replot();
显示的错误是:
Unhandled exception at 0x58e828f1 (QtCored4.dll) in ex4.exe: 0xC0000005:
Access violation reading location 0x00000050.
断点在这里(QList.h 文件):
inline int size() const { return d->end - d->begin; }
最佳答案
请尝试:
x[i] = i/50 - 1;
一切正常
关于c++ - QcustomPlot 不想绘制图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15406694/
说明 使用 QCustomPlot 绘图库辅助开发时整理的学习笔记。同系列文章目录可见 《绘图库 QCustomPlot 学习笔记》目录 。本篇介绍 QCustomPlot 帮助文档的配置
说明 使用 QCustomPlot 绘图库辅助开发时整理的学习笔记。同系列文章目录可见 《绘图库 QCustomPlot 学习笔记》目录 。本篇介绍 QCustomPlot 的一种使用方法
我用qcustomplot来画item。 我有两个项目。一个是项目文本,另一个是项目矩形。 我想做的是当我选择文本时,项目矩形改变颜色。 我已经使用 itemAt 来检查鼠标是否点击了一个项目。 但是
我正在开发一个带有绘图的简单 GUI,您可以在其中设置一些 x 和 y 范围。我如何从绘图上所有图形中选择这些范围内的所有项目?我试图重现在 mouse rectangular multi range
我是 QCustomPlot 的新手,想开始第一个关于基本用法的 QCustomPlot 示例。在下面的代码中:我总是有一个断点,它在程序即将调试时停止程序(没有错误并且构建成功完成) QCustom
我需要在程序测试期间创建一系列绘图。我想为此目的使用 QCustomPlot,但我遇到了问题。为了在文件中创建和保存我的绘图,我必须创建 QApplication,在我需要从 QMainWindow
我正在尝试使用上下文菜单将新的 sub-axes 图添加到现有的 qcustomplot 小部件。如果我在类构造函数中调用我的 _addGraph 函数,它会按预期工作。但是,如果我将它用作 slot
我正在使用 QCustomPlot 并在屏幕上绘制了多个图形,我希望能够单击并指向然后能够获取我单击的点的数据或坐标等上,我知道这对于使用 QCP::iSelectPlottables 的整个图本身是
使用 QT 的 QCustomPlot 插件。我不得不绘制可能非线性的点,因此图形可能看起来像这样 结果如何 但这是显示的内容 使用这段代码 plotter->addGraph();
使用 qcustomplot 创建绘图后,如何根据现有的 X 值检索 Y 值,然后在这些位置绘制点? 我的尝试如下: 创建情节: 此函数创建一个绘图,在 x 轴上添加一些数据(日期)并在 y 轴上添加
我想问一个关于qcustomplot的问题。如何根据 Slider 更改 itemLine 位置? (比如 x = a) #include "itemline.h" #include "ui_item
我使用 QCustomPlot 来显示图片的直方图。我用来设置曲线的函数如下: void SingleHistogram::setHist(const QVector &x,
QCustomPlot 具有接受 const 变量的 setData 函数。有没有办法让 QCustomPlot 可以用来动态绘图?QCustomPlot setData 函数接受常量 vector
说明 使用 QCustomPlot 绘图库辅助开发时整理的学习笔记。同系列文章目录可见 《绘图库 QCustomPlot 学习笔记》目录 。本篇介绍如何使用 QCustomPlot 绘制
有没有办法在隐藏网格的同时在 QCustomPlot 中显示零线?我尝试用以下行隐藏网格: ui->customPlot->xAxis->grid()->setVisible(false); ui->
我想绘制每 100 毫秒出现的大量数据 (3k)。我试过 QCustomPlot和 Qwt精确的 3k 点,我在使用 Qwt 绘图时表现非常好,而使用 QCustomPlot 时表现非常糟糕。我认为我
我成功地在 visual studio 2012 中构建了一个程序,该程序在没有插件的情况下运行 QT。我包含了 QT include 文件夹并手动将库添加到资源中。然后它编译并运行。 现在我想以相同
我目前正在开发一个实时绘制来自 ADC 的数据的应用程序。在某些情况下,我必须绘制大约 150k 个点,这需要一些时间。所以问题是数据到达的频率可能比我能够绘制的频率更高。 我不需要高帧率。我也可以努
我使用 Windows 7 x64、Qt 5.6、Visual Studio 2015、QCustomPlot 1.3.2。我需要从传感器(实时)绘制温度图。我每 500 毫秒接收一次温度值(频率 =
我正在尝试将文本项添加到 QCustomPlot 上小部件。 QCPItemText构造函数接受一个指向 QCustomPlot 的指针小部件作为参数。 QCPItemText::QCPItemTex
我是一名优秀的程序员,十分优秀!