PR: Make QApplication.exec_ a simple alias for QApplication.exec (Qt6)#473
PR: Make QApplication.exec_ a simple alias for QApplication.exec (Qt6)#473rear1019 wants to merge 1 commit intospyder-ide:masterfrom
QApplication.exec_ a simple alias for QApplication.exec (Qt6)#473Conversation
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
dalthviz
left a comment
There was a problem hiding this comment.
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 |
QApplication.exec_ a simple alias for QApplication.exec (Qt6)
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 ofQApplicationin 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