Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-66720

QMovie, gif and API to control loop count

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.9.4, 5.10.1
    • None

    Description

      It would be nice if a newcomer could find easily how to loop only once a gif image (or even better explicitly setting the count) .

      Right now one have to use

      frameChanged

      and 

      currentFrameNumber

      in order to loop only once as shown in this thread.

      connect(movie, &QMovie::frameChanged, this,
          [movie]()
          {
              if(movie->currentFrameNumber() == (movie->frameCount() - 1))
              { 
                  movie->stop(); 
                  emit movie->finished(); 
                  //void QMovie::stop() doesn't emit it automatically
              }
           }
      );
      

      Something like

      void QMovie::setloopCount(int count)

      could be very useful. If this isn't possible, at least please consider providing an example in the Documentation.

      I am willing to write one if I am asked to.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            petross404 Petros S
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes