[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] Re: QAbstractItemModel 64 bit problem
From:       Jeremy Sanders <jeremy () jeremysanders ! net>
Date:       2006-09-26 11:16:58
Message-ID: Pine.LNX.4.64.0609261214510.16689 () xpc17 ! ast ! cam ! ac ! uk
[Download RAW message or body]

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 afraid I'm replying to my own posting, but here is a short program to 
demonstrate the issue:

---------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class C(QAbstractItemModel):
     pass

a = C()
i = id(a)
index = a.createIndex(0, 0, i)

print index.internalId(), i
---------------------------------------------

On 32 bit x86 this prints:

-1208606100 -1208606100

On 64 bit x86_64 this prints

-1788599016 182894994712

I couldn't see this mentioned in the mailing list archive.

Jeremy

-- 
Jeremy Sanders <jeremy@jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic