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

Eric Firing efiring at hawaii.edu
Wed Jul 6 16:23:33 EDT 2011


On 07/06/2011 05:34 AM, MinRK wrote:
> I updated my IPython PR with my understanding of the recent discussion.
>
> Now, QT_API will be asked *first*, and if QT_API=pyqt, IPython will
> set the v2 APIs.
>
> QT_API=pyqt : use pyqt with v2
> QT_API=pyside : use pyside
> QT_API unset : ask matplotlib for pyqt4 or pyside, will not set v2 APIs
>
> The default, and most likely case remains PyQt4 without updating sip
> apis, falling back on PySide.

I have updated my mpl PR in a compatible way; the only difference is 
that I have not included a fall-back to pyside.  Either PyQt4 or PySide 
is specified as an rcParam, and if whatever is specified (either 
explicitly there or via the QT_API env var) is not there, an ImportError 
will result.  Anyone who has only PySide will have to know about it and 
use the rcParam or QT_API to request it.

Eric

>
> -MinRK
>
> On Wed, Jul 6, 2011 at 08:23, Evan Patterson<epatters at enthought.com>  wrote:
>> [snip]
>>
>>> Darren et al.,
>>>
>>> Is all this good from your mpl/qt standpoint?  We could make mpl pay
>>> attention to the ETS QT_API environment variable, if present, while
>>> retaining the rcParam.  For example, QT_API could simply override the
>>> rcParam, with the additional effect of forcing v2 in the PyQt4 case.  In
>>> other words, if QT_API is defined, we would follow the original ETS
>>> strategy; otherwise the rcParams strategy as in my last mpl pull
>>> request.  I think that although this is a bit more complicated, and
>>> would require one more iteration on the ipython side as well as on the
>>> mpl side, it might last longer as a way to handle just about all
>>> situations, including mpl mixed with ETS things.
>>>
>>> Regarding PySide: I actually can't get it to work in interactive mode
>>> (that is, display a plot) even from the straight python prompt; it is
>>> working in interactive mode at present only in the ipython qtconsole.
>>> As of April, PySide apparently did not use the input hook:
>>>
>>> http://lists.pyside.org/pipermail/pyside/2011-April/002362.html
>>>
>>> Google didn't turn up anything more recent.  So how is it that pylab
>>> with PySide is working in qtconsole?
>>>
>>> Eric
>>
>> PySide works in the qtconsole because the ZMQ kernel actually starts the event loop, unlike the single process IPython shell. (It can do this, of course, because it does not need to prompt the user for any input.)
>>
>> Evan
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev




More information about the IPython-dev mailing list