Reputation:
I am using QT 4.7.0. I have created a project in Windows. I am using some icons on buttons, but when I move the .exe file to another Windows machine the icons don't show. If I run the program in the on the development machine, the icons appear.
I created a qrc file and added the icons to it.
Upvotes: 3
Views: 8242
Reputation: 6819
Probably you are having a plugin issue. QT comes with many plugins and your application can not find them on new target.
Check out this this link. Copy the plugins to new target and use qt.conf method to indicate plugin paths.
Upvotes: 7
Reputation: 18
Please see this page if you can not solve it currently.
Click Setting the Application Icon on Windows.
Upvotes: 0
Reputation: 2406
I think you need to link the image plugin dlls at run time.
copy necessary dlls in the plugins folder from your Qt directory into your deployment directory and load it.
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QString sDir = QCoreApplication::applicationDirPath();
a.addLibraryPath(sDir+"/plugins");
//*********** do your things
return a.exec();
}
Upvotes: 1
Reputation: 6329
Your code needs to reference the icons in the resource bundle and not the icons with harddisk paths, e.g.
QIcon icon(":/resources/icon.ico");
and not
QIcon icon("resources/icon.ico");
Profiling a debug version on the target machine with depends.exe will help you show, whether OrcunC or my guess is correct.
Upvotes: 3