2022-04-10 QT6.0以上使用qcustomplot报错简单解决法
2024-04-10 05:30:18  阅读数 3442

qcustomplot是qt一个好用的图形绘制库,最近更新qt版本到6.2.4后,发现原先的qcustomplot会报错,报错原因如下:


图片.png

MinGW_64_bit-Debug\debug\moc_qcustomplot.cpp:249: error: template argument 1 is invalid
debug\moc_qcustomplot.cpp:249:54: error: template argument 1 is invalid
249 | , QtPrivate::TypeAndForceComplete<QCP, std::true_type>
| ^

官网上找到了解决方法,分享一下,直接使用以下我分享的qcustomplot.h文件替换掉项目中的qcustomplot.h即可(个人建议:构建设置里面不选影子构建)。

图片.png

文件分享:
(https://upload-images.jianshu.io/upload_images/22651785-73f6988e4b0339e4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

觉得有用的话点个赞吧。