GIF animation in Qt

后端 未结 4 1376
慢半拍i
慢半拍i 2020-12-01 04:10

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

m_Scene->addPixmap(QPixmap(f         


        
4条回答
  •  被撕碎了的回忆
    2020-12-01 04:19

    Give the proper path of resource look like as below code

    QMovie *movie=new QMovie(":/images/foo.gif");
    if (!movie->isValid()) 
        {
         // Something went wrong :(
        }
    
    // Play GIF
    label=new QLabel(this);
    label->setGeometry(115,60,128,128);
    label->setMovie(movie);
    movie->start();
    

提交回复
热议问题