def __init__(self, app=None): super(GAUDInspectView, self).__init__() self.app = app self.setWindowIcon(QtGui.QIcon(':/logo.png')) self.glcontext = QtOpenGL.QGLContext(QtOpenGL.QGLFormat(), None) self.setAcceptDrops(True) self.initUI() self.show()
def getSharedWidget(): if not GLWidget.sharedWidget: fmt = QtOpenGL.QGLFormat() fmt.setRgba(True) fmt.setAlpha(True) fmt.setDepth(True) fmt.setDoubleBuffer(True) fmt.setSampleBuffers(True) fmt.setSwapInterval(0) QtOpenGL.QGLFormat.setDefaultFormat(fmt) hiddenWindow = QtOpenGL.QGLWidget(QtOpenGL.QGLContext(fmt, None)) GLWidget.sharedWidget = hiddenWindow hiddenWindow.makeCurrent() return GLWidget.sharedWidget