Is there a way to have a (animated) GIF as a system tray icon with pyqt?
1 answer
Use QMovie
to play an animated gif and update the tray icon on every new frame event:
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();
...
void MyWidget::updateIcon() { m_icon->setIcon(m_gif->currentPixmap()); }
Sorry for the C ++ example, I don't have PyQt.
+3
source to share