opensubscriber
   Find in this group all groups
 
Unknown more information…

p : pykde@mats.imk.fraunhofer.de 26 September 2006 • 6:01PM -0400

[PyKDE] QAbstractItemModel 64 bit problem
by Jeremy Sanders

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi -

I have some code which doesn't appear to work on x86_64 python, but does on
i386

def MyModel(qt4.QAbstractItemModel):

     ...

     def __init__(self, ...):
         self.objdict = {}
         ...

     def index(self, row, column, parent):
         """Construct an index for a child of parent."""

         if not parent.isValid():
             parentobj = None
         else:
             parentobj = self.objdict[parent.internalId()]

         children = self._getChildren(parentobj)

         c = children[row]
         cid = id(c)
         self.objdict[cid] = c

         return self.createIndex(row, column, cid)

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 seem to remember the old example simpletreemodel.py used internalId, but does
no long. Maybe this could reproduce the problem (I don't have a copy, and old
PyQt versions aren't archived).

Jeremy

_______________________________________________
PyKDE mailing list    PyKDE@mats...
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.