Skip to content

Fix signal to callable connects - #364

Open
usiems wants to merge 3 commits into
mainfrom
fix_signal_to_callable_connects
Open

Fix signal to callable connects#364
usiems wants to merge 3 commits into
mainfrom
fix_signal_to_callable_connects

Conversation

@usiems

@usiems usiems commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Originally this was only meant to fix #362, but then I noticed that a test in our MeVisLab code base failed after the change because of a faulty assumption regarding connections to user-created slots, and so I entered issue #363 and fixed that, too.

I must admit that I am a little bit uneasy about this change, because with these changes the type of connection used (and the target object) depends on factors that are not readily apparent, while before there could be misconceptions about the targeted object in the connect.

I'm open to suggestions.

It is probably advisable to review the commits separately.

usiems added 3 commits August 20, 2026 16:45
as this seems to be the limit imposed by Qt. If we reach that number,
wrap around and search for free slot ID.
Also always call the callables on the thread that emitted the signal,
and fix a potential thread safety issue.
Fixes #362
or a signal/signal connect, if the argument is a signal object.
Only if the argument is a regular callable create a new receiver object.
This will change the behavior of connects with regard to threads
in some cases!

Fixed #363

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
@usiems
usiems force-pushed the fix_signal_to_callable_connects branch from e241e72 to 100cb30 Compare August 21, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't connect and disconnect Python callables to signals indefinitely

1 participant