Python 有没有办法将(动画)GIF图像作为pyqt的系统托盘图标?
我已经用pyqt创建了静态(PNG)图像作为托盘图标 对静态托盘图标中的GIF图像结果执行相同操作。是否可以使用pyqt在系统托盘中设置动画Python 有没有办法将(动画)GIF图像作为pyqt的系统托盘图标?,python,qt,pyqt,system-tray,Python,Qt,Pyqt,System Tray,我已经用pyqt创建了静态(PNG)图像作为托盘图标 对静态托盘图标中的GIF图像结果执行相同操作。是否可以使用pyqt在系统托盘中设置动画 QtGui.QSystemTrayIcon.__init__(self, parent) self.setIcon(QtGui.QIcon("Image.gif")) 使用QMovie播放动画gif,并在每个新帧事件上更新托盘图标: m_icon = new QSystemTrayIcon(); m_icon->show(); m_gif = ne
QtGui.QSystemTrayIcon.__init__(self, parent)
self.setIcon(QtGui.QIcon("Image.gif"))
使用
QMovie
播放动画gif,并在每个新帧事件上更新托盘图标:
m_icon = new QSystemTrayIcon();
m_icon->show();
m_gif = new QMovie(":/animated.gif");
connect(m_gif, SIGNAL(frameChanged(int)), this, SLOT(updateIcon()));
m_gif->start();
对不起,对于C++示例,我没有安装PyQt。
void MyWidget::updateIcon()
{
m_icon->setIcon(m_gif->currentPixmap());
}