Show More
@@ -594,6 +594,35 b' garbage collected until the application itself is destroyed.' | |||
|
594 | 594 | |
|
595 | 595 | .. _Gotchas: http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/gotchas.html#garbage-collection |
|
596 | 596 | |
|
597 | Embedding the QtConsole in a Qt application | |
|
598 | ******************************************* | |
|
599 | ||
|
600 | In order to make the QtConsole available to an external Qt GUI application (just as | |
|
601 | :func:`IPython.embed` enables one to embed a terminal session of IPython in a | |
|
602 | command-line application), there are a few options: | |
|
603 | ||
|
604 | * First start IPython, and then start the external Qt application from IPython, | |
|
605 | as described above. Effectively, this embeds your application in IPython | |
|
606 | rather than the other way round. | |
|
607 | ||
|
608 | * Use :class:`IPython.qt.console.rich_ipython_widget.RichIPythonWidget` in your | |
|
609 | Qt application. This will embed the console widget in your GUI and start the | |
|
610 | kernel in a separate process, so code typed into the console cannot access | |
|
611 | objects in your application. | |
|
612 | ||
|
613 | * Start a standard IPython kernel in the process of the external Qt | |
|
614 | application. See :file:`examples/lib/ipkernel_qtapp.py` for an example. Due | |
|
615 | to IPython's two-process model, the QtConsole itself will live in another | |
|
616 | process with its own QApplication, and thus cannot be embedded in the main | |
|
617 | GUI. | |
|
618 | ||
|
619 | * Start a special IPython kernel, the | |
|
620 | :class:`IPython.kernel.inprocess.ipkernel.InProcessKernel`, that allows a | |
|
621 | QtConsole in the same process. See :file:`examples/inprocess/embedded_qtconsole.py` | |
|
622 | for an example. While the QtConsole can now be embedded in the main GUI, one | |
|
623 | cannot connect to the kernel from other consoles as there are no real ZMQ | |
|
624 | sockets anymore. | |
|
625 | ||
|
597 | 626 | Regressions |
|
598 | 627 | =========== |
|
599 | 628 |
General Comments 0
You need to be logged in to leave comments.
Login now