# Module: `qt.util`

Defines miscellaneous Qt-related helper classes and functions.

## 2 Classes

class `IPython.qt.util.``MetaQObjectHasTraits`(mcls, name, bases, classdict)

  Bases: `PyQt4.QtCore.pyqtWrapperType`, `IPython.utils.traitlets.MetaHasTraits`

  A metaclass that inherits from the metaclasses of HasTraits and QObject.

  Using this metaclass allows a class to inherit from both HasTraits and QObject. Using SuperQObject instead of QObject is highly recommended. See QtKernelManager for an example.

  `__init__`(mcls, name, bases, classdict)

class `IPython.qt.util.``SuperQObject`(*args, **kw)

  Bases: `PyQt4.QtCore.QObject`

  Permits the use of super() in class hierarchies that contain QObject.

  Unlike QObject, SuperQObject does not accept a QObject parent. If it did, super could not be emulated properly (all other classes in the heierarchy would have to accept the parent argument–they don’t, of course, because they don’t inherit QObject.)

  This class is primarily useful for attaching signals to existing non-Qt classes. See QtKernelManagerMixin for an example.

  `__init__`(*args, **kw)

## 1 Function

`IPython.qt.util.``get_font`(family, fallback=None)

  Return a font of the requested family, using fallback as alternative.

  If a fallback is provided, it is used in case the requested family isn’t found. If no fallback is given, no alternative is chosen and Qt’s internal algorithms may automatically choose a fallback font.

  Parameters:

  family : str

  > A font name.

  fallback : str

  > A font name.

  Returns: | font : QFont object