Question

I'm trying to get my Qt application to display an icon in the Unity Launcher but it's not working. In code, I'm simply using:

qApp->setWindowIcon(QIcon("path/to/icon.png"));

but it's not doing anything. I've also tried setting the icon directly on the main window but it doesn't help either.

Any idea what could be the issue?

PS: I've checked the icon path and it is correct.

Was it helpful?

Solution

Without knowing the details of unity, I'm pretty sure that you'll have to create and install a .desktop file with the icon in it. See for example here. Whatever you set at runtime, the launcher cannot know about before starting the application, so it will need the information from an external configuration.

OTHER TIPS

To enable picture encoding in Windows(not in Ubuntu) I've put the QT\4.8.3\plugins\imageformats folder near my app. I think You should try the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top