util.py
25 lines
| 810 B
| text/x-python
|
PythonLexer
epatters
|
r2643 | """ Defines miscellaneous Qt-related helper classes and functions. | ||
""" | ||||
# System library imports. | ||||
epatters
|
r2765 | from PyQt4 import QtCore | ||
epatters
|
r2643 | |||
# IPython imports. | ||||
from IPython.utils.traitlets import HasTraits | ||||
epatters
|
r2756 | #----------------------------------------------------------------------------- | ||
# Metaclasses | ||||
#----------------------------------------------------------------------------- | ||||
epatters
|
r2643 | |||
MetaHasTraits = type(HasTraits) | ||||
MetaQObject = type(QtCore.QObject) | ||||
Brian Granger
|
r2726 | # You can switch the order of the parents here and it doesn't seem to matter. | ||
epatters
|
r2643 | class MetaQObjectHasTraits(MetaQObject, MetaHasTraits): | ||
""" A metaclass that inherits from the metaclasses of both HasTraits and | ||||
QObject. | ||||
Using this metaclass allows a class to inherit from both HasTraits and | ||||
QObject. See QtKernelManager for an example. | ||||
""" | ||||
epatters
|
r2702 | pass | ||