开发者

qticon only showing on my pc

i made an app in the tray bar with an icon with qt, this is the way i make the icon;

trayIcon->setIcon(QIcon("favicon.ico"));

but it only show the icon on my pc, when i give the project to somebody else its just invisible. even if i do the next thing;

trayIcon->setIcon(QIcon(QDir::currentPath() +开发者_运维知识库 "/favicon.ico"));

does somebody know this problem? / how to solve it? THNX!!!


Are you sure you have deployed the favicon.ico to the other computers? I recommend that you put the favicon.ico file to the resource file. More information about Qt resource system.

If you want to keep the icon as a separate file, you could try to change QDir::currentPath() to QApplication::applicationDirPath(). The current path might not be the application path in those other computers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜