[PyKDE] Re: Auto-disconnection of signals broken?

Phil Thompson phil at riverbankcomputing.co.uk
Sat Mar 4 10:49:08 GMT 2006


On Tuesday 14 February 2006 4:34 pm, Giovanni Bajo wrote:
> Phil,
>
> Using PyQt snapshot-20051212 and SIP snapshot-20051212:
>
> ---------------------------------------------------------------
> from qt import *
>
> app = QApplication([])
>
> o = QObject(None)
> w = QWidget(None)
>
> QObject.connect(o, PYSIGNAL("FOO"), w.update)
> o.emit(PYSIGNAL("FOO"), ())
>
> w.deleteLater()
> o.emit(PYSIGNAL("FOO"), ())
>
> app.sendPostedEvents(w, QEvent.DeferredDelete)
> o.emit(PYSIGNAL("FOO"), ())
> ---------------------------------------------------------------
> Traceback (most recent call last):
>   File "D:\Work\caligola3d\src\pyqtbug9.py", line 17, in ?
>     o.emit(PYSIGNAL("FOO"), ())
> RuntimeError: underlying C/C++ object has been deleted
>
>
> Shouldn't the signal be automatically disconnected when the widget dies?

Should be fixed in tonight's SIP snapshot.

Phil




More information about the PyQt mailing list