-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
PR: Qt 6: QApplication: Make exec_() a simple alias for exec() #473
base: master
Are you sure you want to change the base?
Conversation
Make exec_() a simple alias for exec() instead of using the possibly_static_exec() helper. Using the helper is not required. Moreover, the helper doesn’t behave correctly if QApplication is monkey patched [1]. [1] as in from qtpy import QtWidgets class PatchedQApplication(QtWidgets.QApplication): ... QtWidgets.QApplication = PatchedQApplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rear1019 sorry for such a late response and thank you for your help here! I think the exec_
handling via the helper was added at #422 but if I understand correctly then seems like its use is not needed at least for QApplication
and it can cause issues for subclasses, right?
Could it be possible to add a test to check for the QApplication
subclassing and exec/exec_
calling case please?
Also, just in case what do you think @ccordoba12 @StSav012 ?
Thanks again for your work here!
This looks good to me, although it's no longer necessary for Spyder. |
@rear1019, thank you for bringing the issue up. I haven't dag deeper than the following paragraph. Well, the However, in Therefore, I thought that as You're totally right that as the calls are always to the static method there, the Finally, please, change |
Leaving it for 2.4.3 should be fine |
See commit message for details. The change is required for Spyder to start with PyQt6/PySide6. Instead of changing
qtpy
, we also could opt for removing the monkey patch ofQApplication
in Spyder: Spyder seems to work without it (However, mind that I haven’t checked beyond “Spyder starts”).[1] See https://github.com/spyder-ide/spyder/blob/e624b704959c965ce5a83991f9e374a7759dc6cc/spyder/app/utils.py#L302-L314