c++ - Is it possible to have an animated QSystemTrayIcon? -
i can't seem find info this. lot of kde apps use animated icons.
as know setting qicon gif won't work, first frame displayed.
i didn't try possible setting new icon every few milliseconds.
/* list of frames */ qlinkedlist<qicon> frames; /* frames icons created images in application resources */ frames << qicon(":/images/icon1.png") << qicon(":/images/icon2.png"); /* set timer */ qtimer timer = new qtimer(this); timer->setsingleshot(false); connect(timer, signal(timeout()), this, slot(updatetrayicon())); timer->start(500); /* update icon every 500 milliseconds */ /* updatetrayicon function (slot) sets next tray icon (i.e. iterates through qlinkedlist frames) */
Comments
Post a Comment