fixed disconnect logic with the proper PySide6 signal checking method.#3771
Conversation
|
It is bit difficult to test it. It seems to work e.g. no errors when closing windows I am getting |
|
Thanks @wpotrzebowski . Can you please tell me how you got this exception from Add Constraints? |
It simply happens when trying to "Add Constraints" |
I have downloaded the installer and tested the functionality - the constraints work well. Can you please test the installer? |
|
Ok, I see what I did... I didn't choose any model and that's when it fails. When models are selected, it works as expected. I guess it is a new bug? |
Please show how you got this error - I can't reproduce the issue in this or in other branches. |
|
I'm seeing the same error as @wpotrzebowski, but I tested the procedure outlined below in v6.1.1 and see the same error there as well. I think this is an existing, but previously uncaught, issue, so it shouldn't hold this PR, IMO. Steps to reproduce:
It seems like the constrained fit panel is enabling the constraint button before a model is selected in the fit pages. |
|
I suppose we can merge this one and create a separate issue for the add constraints error? |
Can someone please accept this PR then so I merge it? |


Description
Before: The code used a try/except approach to blindly attempt disconnecting signals, catching RuntimeError exceptions when signals weren't connected. We tried three ways to check signal connection status, which didn't work with Qt 6.2.4.
After: The code now uses the proper isSignalConnected() method with QMetaMethod.fromSignal(), which is the official and clean way to check if a signal is connected before attempting to disconnect it.
The proper usage pattern is
as per https://doc.qt.io/qtforpython-6/PySide6/QtCore/QObject.html#PySide6.QtCore.QObject.isSignalConnected
Fixes #3205
How Has This Been Tested?
Local testing
Review Checklist:
Documentation (check at least one)
Installers
Licensing (untick if necessary)