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

Stubs don't include __init__ for QtCore.QEvent.Type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      Linux, Python3.8, 0.782

      Description

      When running mypy I am getting:

      qtrio/_core.py:34: error: Too many arguments for "Type"

      for:

      REENTER_EVENT: QtCore.QEvent.Type = QtCore.QEvent.Type(REENTER_EVENT_HINT)

      The code works with both PyQt5 and PySide2. PyQt5 also passes mypy for this using PyQt5-stubs anyways. help(QtCore.QEvent.Type) gives class Type(builtins.int) for PyQt5 and class Type(builtins.object) for PySide2. I get the same for QtCore.QJsonValue.Type so I guess it might be a generic shiboken.EnumType issue or such.

        Attachments

        1. QtCore_new.pyi
          599 kB
        2. QtCore_old.pyi
          600 kB
        For Gerrit Dashboard: PYSIDE-1347
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            altendky Kyle Altendorf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There is 1 open Gerrit change