[PyQt] Freezes and crashes with signal autoconnection
Christian Roche
christian.roche.fr at gmail.com
Fri Dec 18 12:50:39 GMT 2009
Phil Thompson-5 wrote:
>
>>I had to replace
>> ImageLink arguments in signal definition with 'PyQt_PyObject', not sure
>>why exactly)
>
> Neither am I.
>
Else I would get the following message:
> TypeError: type 'classobj' is not supported as a pyqtSignal() type
> argument type
>
which is funny because the documentation seems to imply that any object can
be passed as a signal argument. It might have something to do with the
metatype mechanism, although this is yet another PyQt part that is totally
obscure to me.
> The bug is this line in get_param()...
>
> res = ulist.first()
>
> ...which returns the first string in the list and *not* a copy of the
> first
> string in the list. The result is that you are still using it after Qt has
> destroyed it. This behaviour is horribly un-Pythonic but allowed (so I
> can't change it as doing so might break other people's code).
>
> Change the line to...
>
> res = ulist[0]
>
> ...and it should be Ok.
>
Ok it looks like it *does* work now. I think it's too bad but ok to keep the
weird behavior for backward compatibility, but at least please someone write
a note about it in the documentation! This bug was horrendous with no erorr
message, no stack trace and a seemingly random occurrence, hence my feeling
that it should have be related to multi-threading. I would never have been
able to solve it by myself.
Anyway everything seems to work fine now. Thanks a lot for your kind support
and patience!
Chris
--
View this message in context: http://old.nabble.com/Freezes-and-crashes-with-signal-autoconnection-tp25716493p26842898.html
Sent from the PyQt mailing list archive at Nabble.com.
More information about the PyQt
mailing list