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

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • Some future version
    • 5.14.1
    • PySide
    • 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

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change