[PyKDE] Auto-disconnection of signals broken?

Giovanni Bajo rasky at develer.com
Tue Feb 14 16:34:50 GMT 2006


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?
-- 
Giovanni Bajo




More information about the PyQt mailing list