IPython Documentation

Table Of Contents

Previous topic

Module: lib.inputhookpyglet

Next topic

Module: lib.irunner

This Page

Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: lib.inputhookqt4

Qt4’s inputhook support function

Author: Christian Boos

1 Function

IPython.lib.inputhookqt4.create_inputhook_qt4(mgr, app=None)

Create an input hook for running the Qt4 application event loop.

Parameters:

mgr : an InputHookManager

app : Qt Application, optional.

Running application to use. If not given, we probe Qt for an existing application object, and create a new one if none is found.

Returns:

A pair consisting of a Qt Application (either the one given or the :

one found or created) and a inputhook. :

Notes

We use a custom input hook instead of PyQt4’s default one, as it interacts better with the readline packages (issue #481).

The inputhook function works in tandem with a ‘pre_prompt_hook’ which automatically restores the hook as an inputhook in case the latter has been temporarily disabled after having intercepted a KeyboardInterrupt.