PDA

View Full Version : .exe icon and mainwindow icon



stella1016
26th October 2011, 12:37
I want to know whether it is possible to use two different icons for the .exe file and the program window icon.
I currently have the icon in .rc file:



IDI_ICON1 ICON "art_ir16x16.ico"


Then it works fine, the .exe file use this icon. But for beautifying reason, I want to show another icon in window corner.
I used code in mainwindow:


setWindowIcon(QIcon("icon_new.png"));


But I have the plugin structure, all the plugin modules can only have information about application icon with code "QApplication::windowIcon()". Instead of set each module for the same icon_new.png repeatly, what could I do to make it easier?

Maybe anything to do in .rc file, e.g. "IDI_MAINFRAME "?

Anyone can help? Thanks in advance.

d_stranz
26th October 2011, 16:24
In your main() procedure, try calling QApplication::setWindowIcon() with your pixmap. If all the plugins call QApplication::windowIcon(), then they should retrieve the one you set at startup.