I have a Qt application that has some embedded JPG files that I want to display. When I compile and run both the debug and release versions on my machine, everything works perfectly. When I copy the application to a thumb drive and run it from there on my machine, it works fine. On the thumb drive and another developer's machine: OK. On the thumb drive on a third, non-developer's machine: no images!
proj.pri
RESOURCES += ./proj.qrc
proj.qrc:
<RCC>
<qresource prefix="/myApp">
<file>Gui/Resources/logo.jpg</file>
<file>Gui/Resources/another_image.jpg</file>
</qresource>
</RCC>
main.cpp:
{
...
QImage *logo = new QImage( ":/myApp/Gui/Resources/logo.jpg" );
QImage *image = new QImage( ":/myApp/Gui/Resources/another_image.jpg" );
myClass *d1 = new myClass( "Some Text", 48, 30, logo );
myClass *d2 = new myClass( "Some More Text", 48, 30, another_image );
...
}
I have confirmed that the images are being added to the executable by commenting out the RESOURCES line in the .pri file. The size of the binary drops by the size of the images plus a bit; when I run the application, the images do not appear. I un-comment the RESOURCES line and everything works as described above.
What am I missing here? A DLL on the non-developer's machine? A
Environment:
- Win XP
- Qt 4.6.1
- Visual Studio 2008
- Qt Creator 1.3.1