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

In PySide6.8 , can not disconnect a signal from a SignalInstance by callable when the connection was made using strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.9.0, 6.8.3
    • 6.8.0, 6.8.2
    • PySide
    • None
    • Windows
    • 96e016d95 (dev), d82958c12 (6.8)

    Description

      The following code used to work up in PySide < 6.8

       

      {{connection = QObject.connect(instance, }}

      {{             SIGNAL('valueChanged(int)'), }}

      {{             instance, }}

      {{             SLOT('my_slot_int(int)'), }}

                   Qt.ConnectionType.DirectConnection)

      # do some stuff

      b = instance.valueChanged.disconnect(instance.my_slot_int)

       

      Starting from pyside 6.8 , the disconnection no longer works :

      c:\d\work\pyqt-stubs\PySide6-stubs\tests\bug_pyside6.py:39: RuntimeWarning: Failed to disconnect (<bound method SomeClassWithSignal.my_slot_int of <_main_.SomeClassWithSignal(0x233eae2a720) at 0x00000233EC90E480>>) from signal "valueChanged(int)".
        b = instance.valueChanged.disconnect(instance.my_slot_int)
      Traceback (most recent call last):
        File "c:\d\work\pyqt-stubs\PySide6-stubs\tests\bug_pyside6.py", line 40, in <module>
          assert b
                 ^
      AssertionError

       

      See full example in the attached file

      Attachments

        1. bug_pyside6.py
          1 kB
        2. pyside3020_diag.diff
          3 kB
        3. pyside3020.py
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            bluebird75 Philippe Fremy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes