#DEFINES += QCUSTOMPLOT_USE_OPENGL # 提供 OpenGL 硬件加速绘图 INCLUDEPATH += $$PWD HEADERS += $$PWD/qcustomplot.h SOURCES += $$PWD/qcustomplot.cpp ## 注:还需要在 *.pro 中添加 QT += opengl #win32-msvc* { # # Windows - MSVC # LIBS += -lOpenGL32 # message("OpenGL for Windows, MSVC.") #} #win32-g++ { # # Windows - MinGW # LIBS += -lopengl32 # message("OpenGL for Windows, MinGW.") #} #unix { # # Linux ---- 安装 OpenGL 开源库 sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev # LIBS += -lGLU # LIBS += -lGL # message("OpenGL for Linux.") #}