[Interest] Where have my images gone?

Konrad Rosenbaum konrad at silmor.de
Fri Nov 1 13:39:41 CET 2013


On Friday 01 November 2013 12:40:18 Graham Labdon wrote:
> My project has images stored as Qt resources and I have somehow broken my
> project so that they are no longer displayed in my application. If I open
> the Qt Resource editor I can see them, I can also see the in QDesigner.
> When I compile the project the qrc_***.cpp file gets generated
> I would be grateful if someone could help me determine why the images are
> not rendered in my application.

does the qrc_*.obj file get generated? Is it about as big as all the images 

If you open the qrc_*.cpp file you should see from the generated comments 
which files were included. Do you find the images you expected?

Check the *.qrc file, are those the same file names that you are using?

<file>hallo.png</file> --> ":/hallo.png"
<file>hello/world.png</file> --> ":/hello/world.png"
<file alias="foo.png">bar.png</file> --> ":/foo.png" (with the content of 

If you try to open one of those files directly what happens. Insert something 
like this to your code:
QFile testfile(":/foo.png");
if(testfile.open(QIODevice::ReadOnly)) qDebug()<<"Can open foo.png";
else qDebug()<<"foo.png missing, probably no qrc included";

If this tests successful: you are probably using an image format that does not 
get loaded when you start the application. Check your imageformat plugins.

As a last resort: use something like GammaRay to check what gets included in 
your program.

> I am using Qt5 with Visual Studio 2012

I feel generous: I forgive you. ;-P

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131101/92b39af8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131101/92b39af8/attachment.sig>

More information about the Interest mailing list