2010-10-08 90 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

相关问题