From 70d9f1eeed1f141cdf1b8e8fbc029cdd8a0e9fef Mon Sep 17 00:00:00 2001 From: John David Reaver Date: Sun, 28 Sep 2014 08:26:13 -0700 Subject: [PATCH] Fix OpenGL shader/texture sharing on PySide --- pyqtgraph/opengl/GLViewWidget.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pyqtgraph/opengl/GLViewWidget.py b/pyqtgraph/opengl/GLViewWidget.py index c71bb3c9..788ab725 100644 --- a/pyqtgraph/opengl/GLViewWidget.py +++ b/pyqtgraph/opengl/GLViewWidget.py @@ -7,6 +7,8 @@ from .. import functions as fn ##Vector = QtGui.QVector3D +ShareWidget = None + class GLViewWidget(QtOpenGL.QGLWidget): """ Basic widget for displaying 3D data @@ -16,14 +18,14 @@ class GLViewWidget(QtOpenGL.QGLWidget): """ - ShareWidget = None - def __init__(self, parent=None): - if GLViewWidget.ShareWidget is None: + global ShareWidget + + if ShareWidget is None: ## create a dummy widget to allow sharing objects (textures, shaders, etc) between views - GLViewWidget.ShareWidget = QtOpenGL.QGLWidget() + ShareWidget = QtOpenGL.QGLWidget() - QtOpenGL.QGLWidget.__init__(self, parent, GLViewWidget.ShareWidget) + QtOpenGL.QGLWidget.__init__(self, parent, ShareWidget) self.setFocusPolicy(QtCore.Qt.ClickFocus)