[PyQt] Re: Re: [PyKDE] Re: QAbstractItemModel 64 bit problem

2007-04-06 Thread Jeremy Sanders
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.createInde

Re: [PyQt] Re: [PyKDE] Re: QAbstractItemModel 64 bit problem

2007-04-05 Thread Phil Thompson
On Thursday 05 April 2007 6:09 pm, Jeremy Sanders wrote: > Phil Thompson wrote: > > This is the correct behaviour. > > > > On 64 bits int is 4 bytes and long and void* are 8 bytes. Python ints are > > actually C longs. The value of id() is greater than 4 bytes so you lose > > bits when you call cre

[PyQt] Re: [PyKDE] Re: QAbstractItemModel 64 bit problem

2007-04-05 Thread Jeremy Sanders
Phil Thompson wrote: > This is the correct behaviour. > > On 64 bits int is 4 bytes and long and void* are 8 bytes. Python ints are > actually C longs. The value of id() is greater than 4 bytes so you lose > bits when you call createIndex(). Thanks for the response - I thought that might be the

[PyQt] Re: [PyKDE] Re: QAbstractItemModel 64 bit problem

2007-04-05 Thread Phil Thompson
I may be slow sometimes, but I'll get there in the end... On Tuesday 26 September 2006 12:16 pm, Jeremy Sanders wrote: > On Tue, 26 Sep 2006, Jeremy Sanders wrote: > > The python Ids appear to be large integer values, e.g. 183006915920, but > > when they are returned from internalId(), then they c

[PyKDE] Re: QAbstractItemModel 64 bit problem

2006-09-26 Thread Jeremy Sanders
On Tue, 26 Sep 2006, Jeremy Sanders wrote: The python Ids appear to be large integer values, e.g. 183006915920, but when they are returned from internalId(), then they come back as negative values e.g., -1676677808L, which don't even appear to match the bit pattern of the original value. I'm