Qt backend submit

All,

I just submitted an update to backend_qt.py and backend_qt4.py. Both updates remove the 'mainloop' flag from the 'show' function as
it is now handled automatically.

Essentially the qt event-loop will only be started by matplotlib if matplotlib was the one to create the qApp, if not then it is up
to the creator of the Qt qApp to start the event-loop when they are ready for it. This allows for applications with embedded Qt
event loops to work with matplotlib. I have run some test cases in a few different python environments (including the vanilla
python) and all seem to be working. I have not, however tested this in the iPython environment (although I don't think that iPython
uses Qt, does it?).

Any feedback would be appreciated.

--James Evans

Essentially
the qt event-loop will only be started by matplotlib if matplotlib was
the one to create the qApp, if not then it is up

to the creator of the Qt qApp to start the event-loop when they are ready for it. This allows for applications with embedded Qt
event loops to work with matplotlib. I have run some test cases in a few different python environments (including the vanilla

python) and all seem to be working. I have not, however tested
this in the iPython environment (although I don’t think that iPython
uses Qt, does it?).
Hello James

Yes, it does. There is a command-line switch to make iPython run the qt mainloop in a separate thread.

Use “ipython -qthread”.

Also, there is “ipython -pylab” that run default GUI toolkit (as defined in matplotlibrc) mainloop in a thread.

···


Regards
Leandro Lameiro

Blog: http://lameiro.wordpress.com