[PyQt] Problem displaying pixmaps added in Qt Designer

Siddhu Warrier siddhu.warrier at ohmsurveys.com
Fri Apr 4 14:44:27 BST 2008


Hi,

No I'm not using a .qrc file, but a .png file itself. I solved one of
the problems - with the label - that had to do with the .ui file using a
different working directory, i.e. I changed:
<property name="pixmap" >
       <pixmap>OHM_logo.png</pixmap>
      </property>
to:

<property name="pixmap" >
       <pixmap>img/OHM_logo.png</pixmap>
      </property>

This is because the .py file is located in ., while the GUI is located
in ./img. However, when I do the same to the icon file, it doesn't seem
to work. 

Thanks,

Siddhu


However the same fix does not work for the 
On Fri, 2008-04-04 at 16:57 +0530, Devendra Laulkar wrote:
> Hi,
> 
> > 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.
> 
> HTH.
> 
> -Devendra Laulkar.
> 
> 
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
-- 
Siddhu Warrier

Graduate Programmer

OHM plc
The Technology Centre
Offshore Technology Park
Claymore Drive
Bridge of Don
Aberdeen
AB23 8GD

Tel: +44 (0) 870 439 6581
Fax: +44 (0) 870 429 6582

Direct Line: +44 (0) 870 458 4792
Mobile: +44 (0) 7973 350 388


This message is confidential and intended solely for the use of the
person to whom it is addressed. The message, any attachments and
response string may contain privileged and confidential information. If
you have received this message in error, please notify the sender
immediately and remove it from your system. Thank you.


More information about the PyQt mailing list