@classmethod
	def __createHoudiniQGLWidget( cls, format ) :

		try :
			import hou
		except ImportError :
			# we're not in houdini - createQGLWidget() will just make a
			# normal widget.
			return None

		import IECoreHoudini

		# Prior to Houdini 14 we are running embedded on the hou.ui idle loop,
		# so we needed to force the Houdini GL context to be current, and share
		# it, similar to how we do this in Maya.
		if hou.applicationVersion()[0] < 14 :
			IECoreHoudini.makeMainGLContextCurrent()
			return cls.__createHostedQGLWidget( format )

		# In Houdini 14 and beyond, Qt is the native UI, and we can access
		# Houdini's shared QGLWidget directly, provided we are using a recent
		# Cortex version.
		return QtOpenGL.QGLWidget( format, shareWidget = GafferUI._qtObject( IECoreHoudini.sharedGLWidget(), QtOpenGL.QGLWidget ) )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUI/GLWidget.py/_GLGraphicsView.__createHoudiniQGLWidget/original