Reputation: 14081
Please consider, this is explicitly asking about an console application.
I know how to set the application icon, which is not the taskbar icon:
For a Qt Widget application, I can set the icon in Qt Creator ( windowIcon
) or use setWindowIcon(QIcon(":/the_icon.ico"));
( see here )
But is there a way to set the icon for a Qt console application?
Upvotes: 1
Views: 1460
Reputation: 98425
You need to include the widgets module in spite of only using a console interface. Then you can use the QSystemTrayIcon
class. It works fine whether it's a console application or not.
If you do not wish to use the QSystemTrayIcon
class, then you have to resort to using winapi.
Remember that the only difference between a "console" application and non-console one on Windows is a flag set in the executable's header. There's no other fundamental difference.
Upvotes: 1