Qt not displaying PNG images on Linux

Posted by ereOn on Stack Overflow See other posts from Stack Overflow or by ereOn
Published on 2010-06-06T09:31:10Z Indexed on 2010/06/06 9:42 UTC
Read the original article Hit count: 343

Filed under:
|
|
|
|

Hi,

I have a software written using Qt which is meant to work on both Windows and Linux.

I use PNG images as icons for my QActions, embedded in a resource.

I have the following tree directory:

/
  resources/
    icons.qrc
    image.png

Here is the content of icons.qrc:

<RCC>
  <qresource prefix="/resources" lang="fr">
    <file alias="image.png">image.png</file>
  </qresource>
</RCC>

I declare my QIcon like that:

QIcon(":/resources/image.png")

Under Windows, it works well but on Linux (I only tried on Ubuntu 10.4 so far), the images aren't displayed.

Is there anything special I have to do for this to work ? Is this a configuration problem ?

Thank you.

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows