On Tue Mar 3 17:46:15 GMT 2009, Thomas Coopman wrote:

> when I'm trying to subclass QListWidgetItem and try to set something I
> get this error: untimeError: underlying C/C++ object has been deleted
>
> some example code that triggers the bug
>
> class ItemListWidgetItem(QListWidgetItem):
>     def __init__(self, item, parent):
>         QListWidgetItem.__init__(parent)
>         self.setText("trigger bug")

You forgot to pass "self" to the base class's __init__() method:

  QListWidgetItem.__init__(self, parent)

David
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to