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 862 - Problems when printing objects
: Problems when printing objects
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: PC Linux
: P3 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-05-23 20:10 EEST by Lauro Moura
Modified: 2011-06-22 20:14 EEST (History)
8 users (show)

See Also:


Attachments
Example (596 bytes, text/x-python)
2011-05-23 20:10 EEST, Lauro Moura
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2011-05-23 20:10:54 EEST
Created attachment 329 [details]
Example

print seems to be broken at least for QGraphicsItems-derived objects. The
attached code shows:

<__main__.MyQObject object at 0xf99f38>
<__main__.MyQWidget object at 0xf99f38>
<PySide.QtGui.MyQGraphicsObject (this = 0x11c0d60 , parent = 0x0 , pos =
QPointF(0, 0) , z = 0 , flags =  ( ) )  at 0xf99f38>
<PySide.QtGui.QGraphicsItem (this = 0x11c2e60 , parent = 0x0 , pos = QPointF(0,
0) , z = 0 , flags =  ( ) )  at 0xf99f38>

Where it should be showing something like:

<__main__.MyQObject object at 0x7f55cf226c20>
<__main__.MyQWidget object at 0x7f55cf226c20>
<__main__.MyQGraphicsObject object at 0x7f55cf226c20>
<__main__.MyQGraphicsItem object at 0x7f55cf226c20>
Comment 1 Hugo Parente Lima 2011-06-02 17:11:54 EEST
After further investigation I concluded it's not broken, QGraphicsItem and
QGraphicsObject both have a tp_repr, and tp_repr is inherited by subtypes, this
explain the printed results.
Comment 2 Lauro Moura 2011-06-02 19:29:36 EEST
It may not be broken but it certainly has erratic/non-intuitive behavior for
classes with tp_repr set.

For the QGraphicsObject-based class, it shows the Python class name but with
the QtGui module.

For the QGraphicsItem-based class, the full Binding class name.
Comment 3 Hugo Parente Lima 2011-06-03 00:24:41 EEST
Fixed printing format in commit:

shiboken/92b36ce73ab6e63f685fd6d501e42d86732bb4a8
Comment 4 renato filho 2011-06-22 20:14:04 EEST
release 1.0.4