[PyKDE] AttributeError: sipThis

Phil Thompson phil at river-bank.demon.co.uk
Fri Jun 28 11:06:00 BST 2002

Stephen Green wrote:

> I get the following error when I'm trying to run the constructor of 
> QCanvasSprite from __setstate__() in my subclass.  I'm trying to use 
> pickle to save the class, so since Qt classes can't be pickled, I'm 
> using __getstate__() and __setstate__().
> File "/usr/lib/python2.2/pickle.py", line 592, in load
>    dispatch[key](self)
>  File "/usr/lib/python2.2/pickle.py", line 943, in load_build
>    setstate(value)
>  File "CanvasPoint.py", line 179, in __setstate__
>    QCanvasSprite.__init__(self, self.pixmapArray, canvas)
>  File "/usr/lib/python2.2/site-packages/qtcanvas.py", line 79, in __init__
>    libqtcanvasc.sipCallCtor(7,self,args)
> AttributeError: sipThis
> Does anybody know how this may be caused?

The usual cause is that you have a sub-class of a Qt class but haven't 
called the __init__ ctor of the Qt class in your sub-class's __init__ ctor.


More information about the PyQt mailing list