tags:

views:

110

answers:

4

i used qt to make an application in the tray. on my pc its a good project and i see the icon in the traybar, but when i release it to give it to sombody else they dont see the icon, its just an invissible square that can be used but it dont show the icon. but on my pc it shows the icon. :S i know it sounds weird but does anybody know how to solve it? or how to set the traybar icon in the resource file?

this->setWindowIcon(QIcon("favicon.ico"));
a.start();
createActions();
createTrayIcon();
trayIcon->setIcon(QIcon("favicon.ico"));
trayIcon->setVisible(true);
trayIcon->show();
A: 
this->setWindowIcon(QIcon("favicon.ico"));
a.start();
createActions();
createTrayIcon();
trayIcon->setIcon(QIcon("favicon.ico"));
trayIcon->setVisible(true);
trayIcon->show();
stefan
Please edit your question instead of adding a new answer. I've edited the question for you in this case, but you still need to delete this answer
Hasturkun
A: 

Check if the icon (favicon.ico) in the same folder as the executable.

PoweRoy
Please use comments rather than answers for questions re: question
Hasturkun
Well if the icon is not in the same folder it's not going to work. Rephrasing my answer to an answer instead of a question.
PoweRoy
A: 

yes its in the same folder

stefan
Please reply to the original answer by adding a comment, instead of posting a new answer to your question
PoweRoy
+3  A: 

Well, I assume that you forgot to provide the icon together with the executable. But in any case, it would be better to embed the icon as resource in the executable. Have a look at the Qt resource documentation. Basically, you just need to create a resource file, add the icon and then change the filename to something like this ":/favicon.ico". By adding the ":/" in front of the filename, Qt knows to load this from the embedded resources.

humbagumba