Results 1 to 9 of 9

Thread: QMovie displays only last frame

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: QMovie displays only last frame

    To show the movie you can just do: movie.start();
    From the context of the OP, I assumed that images from the animated GIF were not contained in a QMovie, but in some other data structure which had to be accessed manually. If it is in fact a QMovie, then movie.start() would obviously be the right choice.

    It's Monday morning here, not fully awake yet.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QMovie displays only last frame

    From the context of the OP, I assumed that images from the animated GIF were not contained in a QMovie, but in some other data structure which had to be accessed manually.
    But then it wouldn't make much sense to jumpToFrame() in the movie, if it is not containing the frames...
    Indeed the OP's choice to loop through the movie while wanting to jump to a specific frame eludes me.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jul 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QMovie displays only last frame

    I am using the loop and jumpToFrame() because the the frame I want to jump to isn't in sequential order (2, 5, 1, 10, 30, 6 ...).

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: QMovie displays only last frame

    I am using the loop and jumpToFrame() because the the frame I want to jump to isn't in sequential order (2, 5, 1, 10, 30, 6 ...).
    Still, you are jumping to many frames in the loop, not to *a* frame, and you see the last one you jumped to.
    First loop over your vector, find your desired frame index, and then, outside the loop do the jump to that index.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: QMovie displays only last frame

    I am using the loop and jumpToFrame() because the the frame I want to jump to isn't in sequential order (2, 5, 1, 10, 30, 6 ...).
    Well, then the QTimer method I suggested would let you do that. Whatever you choose to do, you have to let Qt's event loop process the paint event generated by the jumpToFrame() call, otherwise you'll only see a frame change when Qt is finally allowed to process events. The QTimer method does that automatically for you since the whole thing is handled within the event loop concept.

Similar Threads

  1. QGL: Tearing in Fullscreenmode with two displays
    By beetleskin in forum Qt Programming
    Replies: 0
    Last Post: 18th January 2011, 17:16
  2. Qt displays large size jpg
    By omegas in forum Qt Programming
    Replies: 14
    Last Post: 22nd April 2010, 05:07
  3. Multiple displays on X11
    By alisami in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2009, 17:25
  4. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2007, 01:35
  5. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 17
    Last Post: 29th April 2006, 01:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.