Results 1 to 2 of 2

Thread: Show Gif from url with QMovie

  1. #1
    Join Date
    Jun 2010
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Show Gif from url with QMovie

    Hi I'm quite new to qt and I'm trying to show an animated gif from an internet url to my mobile application.

    Qt Code:
    1. QByteArray ba = SyncHTTP::requestImg( QUrl(strUrl) );
    2. QBuffer * data = new QBuffer(&ba);
    3. QMovie *gif = new QMovie(data);
    4. ui->myLabel->setMovie(gif);
    5. gif->start();
    To copy to clipboard, switch view to plain text mode 

    where SyncHTTP::requestImg( QUrl(strUrl) ); returns a ByteArray of my gif image. (works fine with an other static image)

    the image is appearing fine but when it's time for the next frame of the gif the program crash. I understand that the problem has to do something with destroying objects, but as I'm not experienced in C++ cannot figure it out...

    Any idea? or other way of implementing it?

  2. #2
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Show Gif from url with QMovie

    Qt Code:
    1. QByteArray *ba= new QByteArray(SyncHTTP::requestImg( QUrl(strUrl));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Should I delete QMovie object when I'm done with it?
    By MorrisLiang in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2010, 15:14
  2. QMovie animation
    By Sahab in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2010, 11:19
  3. events of QMovie
    By talk2amulya in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2009, 08:54
  4. QMovie
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 24th August 2007, 14:23
  5. Problem with QMovie
    By yellowmat in forum Newbie
    Replies: 2
    Last Post: 30th March 2006, 09:28

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.