Important: Please read the Qt Code of Conduct -

[SOLVED]How to play gif animation in QGraphicsView widget

  • The following code only shows a frame:
    @ scene.addPixmap(QPixmap::fromImage(image)); // image is a QImage object@

  • I guess you could add a QGraphicsProxyWidget to your scene

    set a QLabel to the ProxyWidget and then set the label to use your gif as a QMovie

    QGraphicsScene scene;
    QLabel *gif_anim = new QLabel();
    QMovie *movie = new QMovie(image);
    QGraphicsProxyWidget *proxy = scene.addWidget(gif_anim);

  • Thanks worked like a charm!

Log in to reply