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 119 - QDataStream <</>> operators not working for QPixmap
: QDataStream <</>> operators not working for QPixmap
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P5 normal
Assigned To: Lauro Moura
:
:
:
  Show dependency treegraph
 
Reported: 2010-01-15 18:43 EET by Lauro Moura
Modified: 2010-03-24 16:28 EET (History)
6 users (show)

See Also:


Attachments
Example of proposed solution (143 bytes, text/x-python)
2010-03-15 20:22 EET, Lauro Moura
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2010-01-15 18:43:48 EET
Some drag and drop examples use a QDataStream to transfer the QPixmap data and
they're failing because the QPixmap remains null after reading the data stream
with >>.

The current test does not check this. I fixed it in the commit:
http://qt.gitorious.org/~lauromoura/pyside/lauromoura-pyside/commit/553c084e299f56583d955434f8f803ab3403bfe7
Comment 1 Lauro Moura 2010-03-01 20:04:55 EET
More QVariant headaches. Instead of calling QPixmap.__rrshift__, calls
QDataStream.__rshift__(QVariant).

Looks like the QVariant converter should be reviewed. That "return true" in the
isConvertible makes these things harder.
Comment 2 Lauro Moura 2010-03-15 20:21:43 EET
I removed the evil "return true" from Converter<QVariant>::isConvertible and
replaced by a more detailed check. (This will kill QVariant support of
PyObjects but this will be fixed later).

After that, the converter was still greedy due to the QVariant(int, void*)
which accepts any class registered in the Qt MetaType registry.

So, the next try will be trying to call the reverse operator on the argument
(see attachment) before going through the original code.

PS: Taking bug.
Comment 3 Lauro Moura 2010-03-15 20:22:28 EET
Created attachment 37 [details]
Example of proposed solution
Comment 4 Lauro Moura 2010-03-22 17:48:14 EET
Fixed with fix[1] in shiboken.

[1]http://qt.gitorious.org/pyside/shiboken/commit/fb5d06e1fed8942ffc934f2ae77c9464e0f8ad40