PDA

View Full Version : How to make an xpm or QIcon have the application colors?



lalesculiviu
21st October 2009, 11:11
I want to create a QIcon from an xpm, just showing an X like symbol with dimentions 16x16. So this icon contains only 2 colors. I want the X to be shown in a menu, and that the color of X is the menu foreground and the color of background is the menu background. How can I make this in the best way?

I thought to get menu palette and get the foreground and background colors and add them in the xpm in the #RRGGBB format, but this may not be portable and is certainly not elegant.

Basically, I need to show an X before a menu item, for some special menu items.