##// END OF EJS Templates
Added support for Ctrl-Enter (unconditionally enter a newline) to ConsoleWidget....
Added support for Ctrl-Enter (unconditionally enter a newline) to ConsoleWidget. This works at the ConsoleWidget level, but it can confuse InputSplitter to create some unintuitive auto-execution results. InputSplitter will probably need some fixes.

File last commit:

r2765:1f32be1b
r2985:d6f22aa1
Show More
util.py
25 lines | 810 B | text/x-python | PythonLexer
""" Defines miscellaneous Qt-related helper classes and functions.
"""
# System library imports.
from PyQt4 import QtCore
# IPython imports.
from IPython.utils.traitlets import HasTraits
#-----------------------------------------------------------------------------
# Metaclasses
#-----------------------------------------------------------------------------
MetaHasTraits = type(HasTraits)
MetaQObject = type(QtCore.QObject)
# You can switch the order of the parents here and it doesn't seem to matter.
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.
"""
pass