[PyQt] Re: Re: [PyKDE] Re: QAbstractItemModel 64 bit problem
Jeremy Sanders
jss at ast.cam.ac.uk
Fri Apr 6 11:09:57 BST 2007
Phil Thompson wrote:
> In fact I could make this work with PyQt so that id() could be used as the
> internal ID, but I don't really see the point as...
>
> idx = a.createIndex(0, 0, data)
> assert idx.internalPointer() is data
>
> ...seems more natural than...
>
> idx = a.createIndex(0, 0, id(data))
> assert idx.internalId() == id(data)
>
> ...and both require you to keep a reference elsewhere to data.
True. I switched my code to use internalPointer when I realised it was
available. I copied the examples originally, which used id.
Jeremy
--
Jeremy Sanders <jss at ast.cam.ac.uk> http://www-xray.ast.cam.ac.uk/~jss/
X-Ray Group, Institute of Astronomy, University of Cambridge, UK.
Public Key Server PGP Key ID: E1AAE053
More information about the PyQt
mailing list