pyqtgraph 在Opengl模式下开启抗锯齿效果
修改pyqtgraph源码文件pyqtgraph/widgets/GraphicsView.py
def useOpenGL(self, b=True):
if b:
if not HAVE_OPENGL:
raise Exception("Requested to use OpenGL with QGraphicsView, but QtOpenGL module is not available.")
from PyQt5.QtWidgets import QOpenGLWidget
from PyQt5.QtGui import QSurfaceFormat, QPainter
v = QtOpenGL.QGLWidget()
v=QOpenGLWidget()
fmt=QSurfaceFormat()
fmt.setSamples(8)
v.setFormat(fmt)
self.setRenderHint(QPainter.Antialiasing)
else:
v = QtGui.QWidget()
self.setViewport(v)