Package: python-qt4-doc
Version: 4.0-2
Severity: normal

Hi,

While trying to run the itemview demos on an AMD64 computer I ran into a 
problem: the 
QModelIndex are built by passing the id() of a python object (which is a C long 
integer) and 
the Qt API requires an int. The value returned by index.internalId() is 
truncated to an int, 
and this value is used to make a lookup in a python dictionary which was built 
using the 
original 64bit value, and therefore we get a KeyError and the demo does not 
work:

simpletreemodel$ python simpletreemodel.py 
Traceback (most recent call last):
  File "simpletreemodel.py", line 119, in parent
    childItem = self.object_dict[index.internalId()]
KeyError: -414219776L
Traceback (most recent call last):
  File "simpletreemodel.py", line 87, in data
    item = self.object_dict[index.internalId()]
KeyError: -414219776L
<snip>


I tried to use index.internalPointer() which returns a reference on the python 
instance being referenced by the model index. This works on i386, and segfaults 
on AMD64. And 
I am afraid that this can lead to strange things on i386 if the TreeItem is 
garbage 
collected.  

I'm CC'ing this bug report the pykde mailing list, where people may have an 
opinion on that 
matter.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-amd64-k8-smp
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) (ignored: 
LC_ALL set to [EMAIL PROTECTED])

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to