[IPython-dev] Qt api selection re. ipython and matplotlib

Eric Firing efiring at hawaii.edu
Mon Jul 4 23:57:24 EDT 2011


On 07/04/2011 04:26 PM, Darren Dale wrote:
> On Mon, Jul 4, 2011 at 9:17 PM, Fernando Perez<fperez.net at gmail.com>  wrote:
>> Hi folks,
>>
>> Eric Firing, Darren Dale and others in the MPL team are trying to work
>> out the Qt API selection issues after our own updates, but there are
>> some technical questions in there that require more knowledge about Qt
>> than I have.  The MPL pull request is:
>>
>> https://github.com/matplotlib/matplotlib/pull/390
>>
>> which follows our own recent changes:
>>
>> https://github.com/ipython/ipython/pull/550#issuecomment-1490217
>>
>> Evan has already done the lion's share of the work on this topic, but
>> I figured I'd ping the list in case someone else can also jump in,
>> since I myself am kind of useless on the details of Qt itself.
>
> Note that this is probably not specific to matplotlib, but rather
> IPython's qt gui support. IPython.external.qt is setting the sip api
> level for PyQt4 to api version 2. Version 2 is not the default for
> python-2, which means that ipython would not be able to run PyQt4 apps
> or scripts that use QString or QVariant, both of which are officially
> supported in the default PyQt4 api. It will impact a lot of users and
> a lot of projects.

Reference:

http://developer.qt.nokia.com/wiki/Differences_Between_PySide_and_PyQt

It seems that the mpl qt4 backend works with Version 1 or 2 (and with 
PyQt4 or PySide) given just a little bit of compatibility shimming.  If 
ipython can similarly get by with a few shims, so that it does not need 
to set the Version, then the problem is solved once those shims are 
identified and installed.

If I remove the version-setting from qt.py, then ipython still works 
with mpl and PyQt4 via "ipython pylab=qt", but it does not work with 
qtconsole or with PySide.

Eric



More information about the IPython-dev mailing list