QcustomPlot开启opengl绘制
1、修改项目pro文件
① QT +=opengl
② DEFINES += QCUSTOMPLOT_USE_OPENGL
③ win32:CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lopengl32 -lglu32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -lopengl32 -lglu32
2、修改代码文件
ui->plot->setOpenGl(true);
3、修改qcustomplot.cpp文件中方法QCPPaintBufferGlFbo::draw
if(QOpenGLContext::currentContext() != mGlContext.data()) {
mGlContext.data()->makeCurrent(mGlContext.data()->surface());
}