1 """Qt context creation and management.
2
3 @author: Stephan Wenger
4 @date: 2012-02-29
5 """
6
7 try:
8 from PySide import QtOpenGL
9 except ImportError:
10 from PyQt4 import QtOpenGL
11
12 from glitter.contexts.context import Context
13
14 -class QtContextWrapper(Context):
15 - def __init__(self, context):
16 super(QtContextWrapper, self).__init__(self)
17 if isinstance(context, QtOpenGL.QGLContext):
18 self._qt_context = context
19 else:
20 self._qt_context = context.context()
21
23 self._qt_context.makeCurrent()
24
33