Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-3043

typing: QMessageBox static methods should support parent = None

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.8.2
    • Type hints
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ctismer Christian Tismer
              bluebird75 Philippe Fremy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes