PDA

View Full Version : QSystemTrayIcon help



SkylineBob
11th January 2010, 22:28
Hi, I have 4 different images that are used as tray icons depending on the application state(on,off,starting,stopping). I want to add a ? image on the icon if a certain event occurs. So when the event occurs the icon would change to the current icon with a ? on it. Do I have to create 4 different icons or is there another way to do it?
I strongly suspect its gonna be easier to create the different icons but I'm curious to know if there's another way.

numbat
12th January 2010, 02:10
You can use QImage (http://www.idevelopsoftware.com/2008/03/use-qimage-to-create-a-composite-image-ie-one-image-with-another-overlaid-on-top-of-it/). Note, to get an QIcon from a QImage:


QIcon icon(QPixmap::fromImage(img));

SkylineBob
13th January 2010, 18:22
Thanks, I'll look into that.