gpt4 book ai didi

c++ - 有可能有一个动画 QSystemTrayIcon 吗?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:57:52 25 4
gpt4 key购买 nike

我似乎找不到任何关于此的信息。但是很多 kde 应用程序使用动画图标。

据我所知,将 gif 设置为 QIcon 是行不通的,因为只会显示第一帧。

最佳答案

我没有尝试过,但每隔几毫秒设置一个新图标可能是可行的。

/* 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)
*/

关于c++ - 有可能有一个动画 QSystemTrayIcon 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3888154/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com