Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Gif animate once



  • Hi,
    how to animate one loop of gif image? I want the gif to be invisible, then on some event it will appear on the screen, animates till the end and then the gif will disappear from the screen.

    Thanks


  • Moderators

    @MartinD In AnimatedImage you can use onFrameChanged handler where in you can check current frame number and total number of frames in the gif and then stop the play when it matches. Something like:

    AnimatedImage {
      source: "animatedimage.gif"
      onFrameChanged: if(currentFrame==frameCount-1) playing = false
    }
    

Log in to reply