I followed the The Qt Resource System guide and the .ico icons appear on Linux.
The icons are not showing up on Windows when I try to run the applicaton from Qt Creator.
I suspect a plugin issue based on Qt/C++: Icons not showing up when program is run under windows O.S but I failed to figure out what to do from the guide How to Create Qt Plugins.
Is it a plugin issue or why aren't the icons showing up on Windows?
If it is a plugin issue: How do I tell my applicaton where to find the qico.dll?
Details of the environment:
Works on: Kubuntu 12.04 LTS, Qt Creator 2.4.1 and Qt 4.7.4 (64 bit)
Fails on: Windows XP SP2 32 bit, Qt Creator 2.4.1 and Qt 4.7.4 (32 bit)
Everyting is at its default (as installed out of the box), I did not mess with the settings.
resources.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/spreadsheet.ico</file>
</qresource>
</RCC>
Also tried with <qresource prefix="/">
.
From the applicaton.pro
RESOURCES +=
resources.qrc
OTHER_FILES +=
images/spreadsheet.ico
In the corresponding source file
QIcon(":/images/spreadsheet.ico")
I also tried as written in Deploying an Application on Windows
QDir plugins(QCoreApplication::applicationDirPath()+"/plugins");
qDebug() << "Plugin directory" << plugins.absolutePath() << "found?" << plugins.exists();
app.addLibraryPath(plugins.absolutePath());
with the qico.dll in the plugins directory. It application prints that the plugins directory exists but the icons still don't show up.
I repeat: it works on Linux.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…