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.


  • 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

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.