[PyKDE] QPointArray error message

Phil Thompson phil at river-bank.demon.co.uk
Thu Sep 21 14:34:43 BST 2000


Jesper Eskilson wrote:
> 
> Try the following program, using PyQt 2.0, sip 2.0.1, qt 2.2.0, and Python
> 2.0b1:
> 
> import sys
> from qt import *
> 
> point1 = QPoint(42,12)
> parray = QPointArray([point1])
> 
> I get the following error:
> 
> [1] ackbar:~/fault-demo -> python test.py
> Traceback (most recent call last):
>   File "test.py", line 5, in ?
>     parray = QPointArray([point1])
>   File "/home/jojo/install/x86-linux-glibc2.1/lib/python2.0/site-packages/qt.py", line 689, in __init__
>     libqtc.sipCallCtor(65,self,args)
> AttributeError: 'QPoint' instance has no attribute '__int__'
> 
> I smelled a spelling error somewhere, but a grep on "__int__" in the PyQt
> sources did not show anything.

The QPointArray ctor takes a list of points expressed as integers - not
a list of QPoints. The code is trying to convert a QPoint to a single
integer which it (correctly) can't do because QPoint does not have an
__int__ method.

Phil




More information about the PyQt mailing list