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 95 - PySide fails if sizeHint() or minimumSizeHint() don't return anything
: PySide fails if sizeHint() or minimumSizeHint() don't return anything
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtGui
: 0.2.1
: All All
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2009-11-09 08:58 EET by Matti Airas
Modified: 2010-03-24 16:41 EET (History)
5 users (show)

See Also:


Attachments
A test script illustrating the sizeHint error message (or lack thereof) (1014 bytes, application/octet-stream)
2009-11-09 08:58 EET, Matti Airas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matti Airas 2009-11-09 08:58:22 EET
Created attachment 26 [details]
A test script illustrating the sizeHint error message (or lack thereof)

I tried to create a custom widget (by copy-pasting some old PyQt test code of
mine). Of course, that wouldn't work, and only after a few hours of debugging I
found the culprit. In PyQt, this works:

    def sizeHint(self):
        pass

In PySide, I get this error:

Traceback (most recent call last):
  File "./hintbug", line 42, in <module>
    form.show()
TypeError: No registered converter was able to produce a C++ rvalue of type
QSize from this Python object of type NoneType

While it's probably all right to not let sizeHint and minimumSizeHint return
illegal values, the error message I received contained no indication on the
location of the code where the problem occurred. Maybe the error messages could
be fixed in these cases?

I attached a pretty minimal test software illustrating the issue.
Comment 1 renato filho 2009-11-17 14:24:27 EET
based on this merge request
(http://qt.gitorious.org/pyside/boostpythongenerator/merge_requests/2117), now
when a virtual function implemented in python return a wrong type this raise a
exception more specific about the problem. In this example you can get some
like that:

Traceback (most recent call last):
  File "./hintbug.py", line 42, in <module>
    form.show()
TypeError: Invalid return value in function QWidget.sizeHint

Any comments??
Comment 2 renato filho 2009-11-24 18:14:55 EET
fixed on PySide release 0.2.2.