From ef9d730d89087cd1bcc19e1208b1f2d7bac4f3d4 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sat, 22 Dec 2012 21:49:40 -0500 Subject: [PATCH] Workaround for Qt bugs on OSX: - use graphics system 'raster' by default - disable OpenGL in QGraphicsView --- __init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 48e90c47..762641c9 100644 --- a/__init__.py +++ b/__init__.py @@ -30,7 +30,10 @@ from . import numpy_fix if 'linux' in sys.platform: ## linux has numerous bugs in opengl implementation useOpenGL = False elif 'darwin' in sys.platform: ## openGL can have a major impact on mac, but also has serious bugs - useOpenGL = True + useOpenGL = False + if QtGui.QApplication.instance() is not None: + print('Warning: QApplication was created before pyqtgraph was imported; there may be problems (to avoid bugs, call QApplication.setGraphicsSystem("raster") before the QApplication is created).') + QtGui.QApplication.setGraphicsSystem('raster') ## work around a variety of bugs in the native graphics system else: useOpenGL = False ## on windows there's a more even performance / bugginess tradeoff.