Create a QApplication for inputhook if one doesn't already exist#9789
Create a QApplication for inputhook if one doesn't already exist#9789Carreau merged 1 commit intoipython:masterfrom
Conversation
|
See discussion on #9784 before merging this. |
| global _appref | ||
| app = QtCore.QCoreApplication.instance() | ||
| if not app: | ||
| return |
There was a problem hiding this comment.
Want to drop a DeprecationWarning/(UserWarning maybe) here if App does not exists ? so that we can remove it at some point later?
There was a problem hiding this comment.
If we do decide to keep it in place, I wouldn't really consider it deprecated.
There was a problem hiding this comment.
I think we broke the use case in 5.0, and I'm fine restoring the behavior in next minor/patch version {especially since LTS]
I don't think in the long run we should create the App if it does not exists.
So I would reinstate it to not break user-code/habits. But warn about it, and remove it in the Py3Only-branch.
|
|
||
| # If we create a QApplication, keep a reference to it so that it doesn't get | ||
| # garbage collected. | ||
| _appref = None |
There was a problem hiding this comment.
90% sure that pyqt/pyside already do this.
There was a problem hiding this comment.
At least one of the options we support seemingly doesn't - I tried without it and things went wrong. I can't remember which one I was testing with, though.
|
@Carreau I disagree about not creating this the App. If the user has asked to use Qt event loop integration, then clearly they want to use Qt 😉 . The Having IPython do this as part of the integration is a big convenience for users. |
Closes gh-9784