2010-10-08 85 views

回答

3

我沒有嘗試這一點,但它可能是通過設定新的圖標每隔幾毫秒。

/* list of frames */ 
QLinkedList<QIcon> frames; 
/* frames are icons created from 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) 
*/ 
1

我想,你有兩種方式:

  1. 嘗試使用GIF動畫文件(開始GIF與QMovie播放),並將它放置在托盤(我不知道這種情況下)

  2. 另一種方法是使用QTimer和幾個不同的圖像。在這裏我找到了an example

相關問題