Deriving from PyQt4.QtCore.QObject

I was trying to connect the signal of an object I had derived from QObject to the slot of a QWidget. It turns out that if you do not call the QObject.__init__ method in your Python object’s __init__ function that you will get a, “RuntimeError: underlying C/C++ object has been deleted”, exception. It took me a bit of time to figure this out, and since the PyQt documention is sometimes lacking I thought I’d share.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: