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

Shiboken6 generates incorrect signatures for Signals with arguments with default values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.6.1, 6.5.4
    • 6.6.0
    • Type hints
    • None
    • Linux/X11
    • 566a2164f (dev), 1a41957a4 (6.6), 7715b2910 (6.5)

    Description

      QtWidgets.pyi:

      class QAbstractButton(PySide6.QtWidgets.QWidget):
          clicked                  : ClassVar[Signal] = ... # clicked()
          pressed                  : ClassVar[Signal] = ... # pressed()
          released                 : ClassVar[Signal] = ... # released()
          toggled                  : ClassVar[Signal] = ... # toggled(bool)
      

      qabstractbutton.h:

      Q_SIGNALS:
          void pressed();
          void released();
          void clicked(bool checked = false);
          void toggled(bool checked);

       

      inspect.getmembers on the object that references the generated bindings for QtWidget clearly show that Shiboken is not even acknowledging the correct signature:

      clicked -- <PySide6.QtCore.SignalInstance clicked() at 0x5555187fcd70>
      toggled -- <PySide6.QtCore.SignalInstance toggled(bool) at 0x5555187fce30>

      Why is this a problem?

      I'm relying on correct signature information to generate my own stubs for a more fully statically typed python experience.

      And if PySide6 wants in the future to support a more complete typing experience, such wrong inferences are going to be an inevitable problem.

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            fboni Francisco Boni Neto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes