[PyQt] Strange behavior with new-style signals and slots
michaelkenth at gmail.com
Mon Apr 2 19:54:57 BST 2012
> Message: 1
> Date: Sun, 01 Apr 2012 13:04:30 +0200
> From: Detlev Offenbach <detlev at die-offenbachs.de>
> To: pyqt at riverbankcomputing.com
> Subject: [PyQt] Strange behavior with new-style signals and slots
> Message-ID: <1362374.ZZnnlU3EYs at jupiter>
> Content-Type: text/plain; charset="us-ascii"
> 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 closed.
> If the signal is emitted thereafter, I get a RuntimeError saying, that the
> 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 by
> reference counter (possibly caused by the double connection).
> Is this a bug in PyQt/sip or do I have to avoid such a situation? 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.
> Detlev Offenbach
> detlev at die-offenbachs.de
Perhaps you want to make use of Qt::UniqueConnection as the connection type.
Note that I believe this will only work correctly on a slot decorated with
pyqtSlot (or that was previously the case anyhow)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt