[PyKDE] Typecasting

mark kimsal chugadie.geo at yahoo.com
Sat Nov 11 01:42:04 GMT 2000

Okay, i've been stuck all day on this problem.

I have a class that subclasses QListViewItem, FTPDirItem.  I populate a
QListView with a few instances of FTPDirItem.  When I connect the signal
from the containing QListView it requires a pointer to an object of type
QListViewItem.  When I try to access object variables inside my SLOT
function I get AttributeErrors.  type(myobj) reveals that the program
thinks the object is a QListViewItem at that point.  I can access
user-defined object methods of FTPDirItem, but whenever I try to access
variables I created in the subclasses' __init__() method I get an
error.  So my question is how can I typecast this object back into an
FTPDirItem inside my SLOT callback function?

More information about the PyQt mailing list