PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 316 - QAbstractItemModel.createIndex is broken
: QAbstractItemModel.createIndex is broken
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-08-25 12:55 EEST by Matti Airas
Modified: 2010-09-10 19:21 EEST (History)
8 users (show)

See Also:


Attachments
AbstractItemModel example (605 bytes, text/x-python)
2010-08-25 12:55 EEST, Matti Airas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matti Airas 2010-08-25 12:55:59 EEST
Created attachment 64 [details]
AbstractItemModel example

The simpledommodel.py example gives the following error, when you try to open
an XML file:

Traceback (most recent call last):
  File "./simpledommodel.py", line 127, in index
    return self.createIndex(row, column, childItem)
AttributeError: DomItem instance has no attribute '__trunc__'


I tried to extract a sample code, although it didn't turn out that clean. It's
attached, anyway. Just copy e.g. pyside-examles/examples/tools/examples.xml to
the same directory, and run it. Works with PyQt, not with PySide.
Comment 1 Hugo Parente Lima 2010-09-01 12:04:47 EEST
Problem found, the stupid PyNumber_Check function from Python C API returns
true for all classes created by the user.
Comment 2 Hugo Parente Lima 2010-09-01 17:01:44 EEST
Fixed in commit
shiboken/7d38f877d69fe44dbe7c36fb15cd477acccb4500
pyside/5c0d39b9dc18450364399f68ba0db3b19a9605c8