[PyKDE] pyuic does not correctly translate QListView pixmaps

Phil Thompson phil at riverbankcomputing.co.uk
Sat Feb 8 00:44:00 GMT 2003


On Friday 07 February 2003 10:33 pm, Tuvi, Selim wrote:
>  Hi, I'd like to report a problem that we are encountering in PyQt 3.5
> Commercial. If in Qt Designer we add a QListView and define a pixmap for
> one or more of the items in the QListView, pyuic does not translate this
> correctly and gives the following error when we run the resulting source:
>
> Traceback (most recent call last):
>   File "form1.py", line 200, in ?
>     w = Form1()
>   File "form1.py", line 183, in __init__
>     self.languageChange()
>   File "form1.py", line 193, in languageChange
>     item.setPixmap(0,image0)
> NameError: global name 'image0' is not defined
>
> What's happening is that image0 is defined as a local variable in __init__
> so languageChange() doesn't know about it.
>
> We got around it by adding the pixmaps in our implementation code but I
> thought I mention this for future releases.

Until I start generating PyQt snapshots again, the attached couple of patches 
should fix it.

Thanks,
Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: form.cpp.patch
Type: text/x-diff
Size: 427 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030208/d630f0e5/form.cpp.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uic.cpp.patch
Type: text/x-diff
Size: 493 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20030208/d630f0e5/uic.cpp.bin


More information about the PyQt mailing list