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

Type hints don't currently support QVariant in signals/slots

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.9.2
    • Type hints
    • Windows 10 22H2, Python 3.12

      Currently, if a signal/slot uses QVariant as an argument or return value, then we need to specify the QVariant type as a string. For example:

      @Slot(result='QVariant')
      

       

      However, this leads to a mypy error (see attached project):

      main.py:22: error: Argument "result" to "Slot" has incompatible type "str"; expected "type | None"  [arg-type]
      

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

            cinucen Ece Cinucen
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes