[PyKDE] PyQt4, inter-thread signals and Python types

Lukáš Lalinský lalinsky at gmail.com
Tue Aug 1 13:24:19 BST 2006


Hi,

I'm trying to use signals/slots inter-thread communication, but I have problems
with using Python objects. First I tried to use "short-circuit" signals, but I
was getting lots of exceptions from garbage collector. I guess the queued
connections are just not implemented for this type of signals, which is
understandable (perhaps QObject.connect could raise an exception when trying to
connect "short-circuit" signal with a QueuedConnection?).

Then I tried QtCore.SIGNAL("someSignal(PyObject *)"), but this just crashes
Python if I use it with a local variable -- it doesn't increment the reference
count. If I keep the reference to the object myself it works fine. Is there some
way to tell PyQt to increment the reference count when calling QObject.connect
with a Python object and decrease it again after calling all slots?

-Lukáš




More information about the PyQt mailing list