-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GUI inputhook for qt 5.15.0 #12355
Conversation
My guess is that:
Might be better to register |
ahh, that makes a lot of sense. I haven't tested it yet, but I wonder whether adding |
ok, looks like # these all fail
notifier.activated.connect(lambda socket, ntype: event_loop.exit())
notifier.activated.connect(lambda socket: event_loop.exit())
def _exit(*args):
event_loop.exit()
notifier.activated.connect(_exit) in qt 5.14.x, the slot was passed the socket identifier as a positional argument, so this was legal: notifier.activated.connect(lambda socket: print(socket)) because I think the fact that so the only syntax that works in both 5.15 and earlier versions is how this PR currently has it:
|
Yikes, glad my speculation at least pointed you in the right direction! If I'm understanding this right, the issue is that pyside is failing inside of its dispatch logic? This probably should be reported upstream as a regression. |
Thanks! I'll see what I can do |
Do you think we needs this kind of workaround in IPython still ? |
looks like it might be fixed in 5.15.1... so it may not be permanently required. that said, it's worth pointing out that while the previous code ( |
Awesome, thanks for working with upstream here @tlambert03 ! I think this should go in anyway, passing the notifier to |
…355-on-7.x Backport PR #12355 on branch 7.x (Fix GUI inputhook for qt 5.15.0)
this fixes #12350
minimal code that reproduces the error:
If you run that script on it's own, you get to see the error that PySide is throwing, which is:
(in a normal
ipython --gui qt
session, the error is not invisible... the interpreter just doesn't accept any input)changing the way
notifier.activated
is connected toevent_loop.exit
fixes the issue. I can't say I completely understand whyevent_loop.exit
is no longer a valid callback for the connection in5.15
... (though I have seen this seemingly unnecessary lambda help in the past with Qt)I'm not sure how to add a test for this, as it seems inputhooks in general aren't being tested?