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

Support the qApp macro correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5: Not important
    • 5.6, 5.9, 5.12.4, 5.13.1
    • 5.6, 5.9
    • Shiboken
    • None
    • 80a6f91c553eaf9ed4d7d002a5abb442693e8e08 (pyside/pyside-setup/5.12) d579912b31d7cfa7b0b216916fbbf3eb632a9d9d (pyside/pyside-setup/5.14)

    Description

      There is a qApp macro in Qt5 which is equivalent to Q*Application.instance().

      Python does not have macros. Both PyQt5 and PySide2 have an according structure in QtWidgets. In the case of PySide2, the qApp variable is first initialized to None and set later when QApplication is created.

      This does not reflect the original sense of the qApp macro, because

       - it only handles QApplication

       - it does not handle destruction.

      This "macro" should live in QtCore, but both PyQt5 and PySide2 decided to put this into QtWidgets as QtWidgets.qApp. As a compromize, I propose to let qApp appear in all three modules, so wherever you create an application, you can find this "macro" in place. In addition, it exists in the builtin module and is therefore freely accessible under the name qApp.

      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
              ctismer Christian Tismer
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes