[PyQt] Problem displaying pixmaps added in Qt Designer

Devendra Laulkar devendra at laulkar.com
Fri Apr 4 12:27:42 BST 2008


> I have a .ui file with a custom .png icon, and a .png image in the
> window (the .png file is displayed by a Label widget). I created the .ui
> file using Qt Designer 4. The preview comes out perfect - the image file
> is located in the same directory.

Have you run pyrcc4 to compile all images into a python file ?
You have to generate a python file from the qrc resource file using pyrcc4.
Eg. if the resource file is image.qrc , I believe you have to run :-

pyrcc4 image.qrc > image_rc.py

A resource file is just an XML file specifying the location of resources.

Check for Qt Resource System in Qt documentation for details.


-Devendra Laulkar.

More information about the PyQt mailing list