Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
6.8.2
-
None
Description
The following static methods accept parent = None :
- QMessageBox.information
- QMessageBox.warning
- QMessageBox.critical
- QMessageBox.question
Example code :
QMessageBox.information(None, 'info', 'info')
QMessageBox.warning(None, 'warning', 'warning')
QMessageBox.critical(None, 'critical', 'critical')
QMessageBox.question(None, 'question', 'question')
QMessageBox.about(None, 'about', 'about')
QMessageBox.aboutQt(None, 'aboutQt')
It's not just a theorical issue. For example, I use QMessageBox.warning in my exception hook to display an better error message on Windows, but I don't have any QWidget instance at hand inside the exception hook.
Reported from PySide6-stubs
See full example : https://github.com/python-qt-tools/PySide6-stubs/blob/main/tests/qmessagebox.py
Attachments
Issue Links
- relates to
-
PYSIDE-2440 Type hints should indicate optionality
-
- Closed
-