You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I worked on adding support for PySide6 in %gui. Discovering how that whole process worked, and how IPython and matplotlib play with each other was tough, so I put in some messages that some people don't like (#14006).
Without these messages, "weird things happen", because you can only run one GUI event loop at once, and all sorts of things can request hook installation (e.g. selecting a matplotlib backend that requires it). So you might be having a nice flowery day and you run some nice GUI someone wrote and nothing happens; no windows, no nothing, because it was written with Tk and something silently hooked the GUI loop for Qt.
If you factor in trying to support multiple Qt versions (i.e. let a user choose between PyQt5 or pyside6 and things get really complicated. There's a lot of back-and-forth mapping which doesn't immediately make sense. A coworker of mine also magically got a pyside6 program to work just fine with a version of IPython which technically does not support pyside6 in %gui so there may even be some voodoo going on in the Qt side of things that just made that work.
So I suggest a few things:
Remove absolutely every mention of qt4 in any GUI<->backend mapping, for completeness.
Consider not supporting the specification of a specific Qt version. i.e. only support %gui qt which will choose the latest Qt package you have and that's that (that's effectively done by the backend2gui mapping).
Implement a %gui all which just hooks everything in. Tk and Qt at least, but maybe we just come up with an "if installed then hook it" type of thing for every supported GUI event loop. I even dare say IPython should just do that at startup, but easy enough for people to configure it to do so.
Activity
shaperilio commentedon May 30, 2023
I've been playing with this... The following sequence actually runs the Qt and Tk event loops at the same time:
The reverse order does not work; Tk apps never wake up again.
In code, I tried to create an input hook like this and then install it in the terminal:
That has the same effect as the working
%guisequence above. Inverting the tk/qt calls does not work.(this is all in Windows)