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

Object methods connect/disconnect clash with signals connect/disconnect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.1
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None

      Description

      If I have a QObject like this:

      class Example(QObject):
          connectChanged = Signal()
      
          def connect(self, url) -> None:
               pass
      
          def disconnect(self) -> None:
               pass
       

      I can't do something like:

      self._example = Example(self)
      # DOES NOT WORK: tries to call Example.connect()/disconnect()
      self._example.connectChanged.connect(self.on_example_connectChanged)
      self._example.connectChanged.disconnect(self.on_example_connectChanged)
      

      It seems to call object connect/disconnect instead of the signal ones.

      >>> self._example.connectChanged.connect(self.on_example_connectChanged)
      TypeError: connect() takes 2 positional arguments but 4 were given
      

        Attachments

        For Gerrit Dashboard: PYSIDE-1264
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            ctismer Christian Tismer
            Reporter:
            teslabs Gerard Marull
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There is 1 open Gerrit change