Windows XP SP3
Visual Studio 2005
Qt 4.6.2 (same problem with 4.5.2)
I build my program in both Debug and Release modes. In the debugger I can see all my icons but running the Release version - no icons (png, jpg, svg). I'm using the Qt resource compiler for my images (this should embed the images into the executable corrrect?).
I thought maybe I needed the '/imageformats' directory but this made no difference (even after adding 'QCoreApplication::addLibraryPath("Z:/MyAppDir/imageformats");' to my QMainWindow constructor).
I add icons using 'const QString' or explicit strings like:
setWindowIcon
( QIcon( ":/images/monkey_on_128x128.png" ) );
setWindowIcon( QIcon( ":/images/monkey_on_128x128.png" ) );
To copy to clipboard, switch view to plain text mode
In the resouces.qrc file this image is listed as:
<file>../images/monkey_on_128x128.png</file>
<file>../images/monkey_on_128x128.png</file>
To copy to clipboard, switch view to plain text mode
I've tried running the executable from the Release directory and the project root directory but, alas, no images appear. I have also created the icon and dump the result (null or not) to my log file. The images never report that they are null.
I went through the forum but saw nothing about this particular situation. Does anyone have any suggestions for me to try?
Bookmarks