PDA

View Full Version : Icons from resource file not shown when linking to Qt statically



grayfox
27th June 2011, 15:22
I have a main window with a toolbar that has some tool buttons on it.
The resource file has just 1 icon and is used as the main window's icon, and tool button's icon.
The code looks like this


setWindowIcon(QIcon(":/my/app.ico"));
toolbar->addAction(QIcon(":/my/app.ico"),"About");

I also had called Q_INIT_RESOURCE in the main.
Everything work fine when linking with Qt dynamically, however the icon won't display in both places when linking with Qt statically.
Please let me know what did I do wrong

ChrisW67
28th June 2011, 04:23
Have you got the ICO image format plugin built in?

grayfox
28th June 2011, 14:47
I am not sure what you are talking about, I can found "qico.lib" under qt_root\plugins\imageformats\, you mean I should link to this lib as well?
Or you mean I have to explicitly specify this lib when building qt statically?

schnitzel
28th June 2011, 18:32
try reading the section on 'static plug-ins':
http://developer.qt.nokia.com/doc/qt-4.7/plugins-howto.html