简体   繁体   English

Qwt simpleplot示例

[英]Qwt simpleplot example

I'm using qwt 6.1.3 for some Qt plotting work and just to test I created a new project, added the library, and pasted the simpleplot.cpp example code into Qtcreator. 我正在使用qwt 6.1.3进行一些Qt绘图工作,并且为了进行测试,我创建了一个新项目,添加了库,并将simpleplot.cpp示例代码粘贴到Qtcreator中。

A copy of the file can be view here: https://github.com/eiimage/qwt/blob/master/examples/simpleplot/simpleplot.cpp 可以在这里查看文件的副本: https : //github.com/eiimage/qwt/blob/master/examples/simpleplot/simpleplot.cpp

The code has returned numerous errors. 该代码返回了许多错误。

curve->setSymbol(symbol);

The above code had to have a * put before symbol to prevent an error. 上面的代码必须在符号前加*号,以防止错误。 Though I'm not sure if this is correct. 虽然我不确定这是否正确。

curve->setSamples(points);

Produces the error: 'class QwtPlotCurve' has no member named 'setSamples'. 产生错误:“类QwtPlotCurve”没有名为“ setSamples”的成员。 However, it's used in the example and also shows up in the document for that class. 但是,它在示例中使用,并且也显示在该类的文档中。 What might be causing this issue? 是什么导致此问题?

Thanks. 谢谢。

This problem was one of documentation. 此问题是文档之一。 All online documentation and examples provided use the methods setSamples and setRawSamples to set the curve points. 提供的所有在线文档和示例都使用setSamplessetRawSamples方法设置曲线点。 This is incorrect. 这是不正确的。 The appropriate method is setData and setRawData . 合适的方法是setDatasetRawData

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM