[PyQt] Strange behavior with new-style signals and slots
phil at riverbankcomputing.com
Sun Apr 1 18:30:37 BST 2012
On Sun, 01 Apr 2012 13:04:30 +0200, Detlev Offenbach
<detlev at die-offenbachs.de> wrote:
> I am observing a strange behavior related to new-style signal and slots.
> is the situation.
> My program calls this line twice in a class (via different code paths).
> The disconnect is only issued once when the class (the editor) is
> If the signal is emitted thereafter, I get a RuntimeError saying, that
> underlying C/C++ object has been destroyed. I suspect, that the Python
> for the Qt object (here it is a QScintilla object) is still kept alive
> reference counter (possibly caused by the double connection).
> Is this a bug in PyQt/sip or do I have to avoid such a situation?
I can't tell from your description - you need to provide a test case.
Making the same connection twice is technically possible, but sounds like
an application bug to me.
> If the
> is the case, is it possible to check, if a signal is already connected,
> something like
> Another consequence of the double connection is, that the slot is called
> when the signal is emitted.
...which is what you would expect.
More information about the PyQt