本文介紹了Qt中的GIF動畫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我使用了 QGraphicsView
、QGraphicsScene
類來在這樣的小部件中顯示圖片:
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 動畫?
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
我取自 this 鏈接.
My loading.gif
I took from this link.
PS:還可以查看 Qt SDK 中的示例.他們真的能幫上忙!
PS: also check the examples from Qt SDK. They are really can help!
這篇關(guān)于Qt中的GIF動畫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!