[PyKDE] Bugs in pyuic3 in current snapshot; Bug in QPixmap.fromMimeSource
Phil Thompson
phil at riverbankcomputing.co.uk
Sun May 18 23:17:01 BST 2003
On Friday 16 May 2003 2:51 pm, Ulrich Berning wrote:
> Hi all,
>
> 1. Since the time the new flag -test was added to pyuic3, the flag -x is
> no longer recognized (easy to fix).
>
> 2. pyuic -embed xxx filenew.xpm generates invalid python code:
>
> .
> .
> .
> # filenew.xpm
> image_0_data = \
> "\x00\x00\x02\x10\x78\x9c\x63\x60\x20\x03\xb0\x42\x00\x03" \
> "\x23\x0e\x71\x26\x46\xec\xe2\xcc\x68\x12\x30\x71\x16\x34" \
> "\x09\x98\x38\x2b\x9a\x04\x4c\x1c\x87\x7b\x30\x64\x47\x9a" \
> "\x38\x15\x00\x00\xc6\xa2\x03\xc1"
>
> image_0_ctable = [
> \xc6c6c6,\xff2e2e2e,\xff5c5c5c,\xff878787,\xffc2c2c2,\xffffffff
> ]
> .
> .
> .
>
> The color table image_0_ctable does not contain valid constants. It
> should be:
>
> image_0_ctable = [
> 0xc6c6c6,0xff2e2e2e,0xff5c5c5c,0xff878787,0xffc2c2c2,0xffffffff
> ]
>
> The attached patch fixes both bugs.
Thanks.
> Anyway, QPixmap.fromMimeSource() returns corrupted images on all my
> plattforms.
>
> The attached images describe what I mean:
>
> toolbar_expected.png - comes from a C++ application and is the same on
> all plattforms (Linux, AIX, Windows).
> toolbar_linux.png - comes from a python application running on Linux.
> toolbar_aix.png - comes from the same python application running on AIX.
> toolbar_win32.png - comes from the same python application running on
> Windows 2000.
>
> Every toolbar icon is duplicated, the first is png format, the second is
> xpm format.
> -----
> When I use xpm format (with a patched version of pyuic, see above), the
> images are completely corrupted, when I use png format, some images seem
> to be ok, some other images are corrupted. I guess there must be a
> memory bug somewhere deep in sip or PyQt. Perhaps it has something to do
> with the data sharing concepts in Qt. I have attached a tar file, that
> contains a sample application in python and in c++. Perhaps someone can
> reproduce this bug.
The fix will be in tonight's snapshot. There were two bugs, one in pyuic and
one in PyQt, both to do with failing to keep buffers around for as long as
they were needed.
Thanks particularly for the comprehensive test case.
Phil
More information about the PyQt
mailing list