GIF动画在Qt [英] GIF animation in Qt

查看:321
本文介绍了GIF动画在Qt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 QGraphicsView QGraphicsScene 类为了在小部件中显示图片, p>

I have used QGraphicsView, QGraphicsScene classes in order to show a picture in a widget like this:

m_Scene->addPixmap(QPixmap(fileName));
m_View->setScene(m_Scene);

如何在同一个场景中显示 .gif p>

How I can show .gif animation in the same scene?

推荐答案

我不使用GIF动画与 QGraphicsView QGraphicsScene ,我只使用它在 QDialog ,但我认为这是相同的东西,所以这里是我的代码:

I don't use GIF animation with QGraphicsView or QGraphicsScene, I use it only in QDialog, but I think it's the same stuff, so here is my code:

QMovie *movie = new QMovie(":/images/other/images/16x16/loading.gif");
QLabel *processLabel = new QLabel(this);
processLabel->setMovie(movie);
movie->start();

我的 loading.gif a href =http://ajaxload.info/>此链接。

My loading.gif I took from this link.

PS:检查来自Qt SDK的示例。他们真的可以帮助!

PS: also check the examples from Qt SDK. They are really can help!

这篇关于GIF动画在Qt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆