Results 1 to 3 of 3

Thread: Supported image format for QMovie?

  1. #1
    Join Date
    Apr 2009
    Posts
    21
    Thanks
    11
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Supported image format for QMovie?

    I have a simple tutorial with QMovie to display an animated gif image. I download the gif file from this link http://www.gifs.net/Animation11/Anim...d_dog_face.gif.

    However calling movie->isValid() always returns false for me. What are the supported file types for QMovie? I thought animated GIF was one of them.

    Thanks in advance for your help.

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include<QWidget>
    3. #include<QHBoxLayout>
    4. #include<QLabel>
    5. #include<QMovie>
    6. #include<QPushButton>
    7. #include<QSlider>
    8. int main(int argc, char *argv[])
    9. {
    10. QApplication a(argc, argv);
    11. QWidget *win=new QWidget();
    12. QPushButton *play=new QPushButton("PLAY");
    13. QPushButton *stop=new QPushButton("STOP");
    14. QSlider *slider=new QSlider();
    15. slider->setMinimum(0);
    16. slider->setMaximum(200);
    17. QLabel *label=new QLabel;
    18. QMovie *movie = new QMovie("anim03.gif");
    19. if (movie->isValid())
    20. label->setMovie(movie);
    21. else
    22. label->setText("asdfasdf");
    23. QObject::connect(play,SIGNAL(clicked()),movie,SLOT(start()));
    24. QObject::connect(stop,SIGNAL(clicked()),movie,SLOT(stop()));
    25. QObject::connect(slider,SIGNAL(valueChanged(int)),movie,SLOT(setSpeed(int)));
    26. lay->addWidget(label);
    27. lay->addWidget(play);
    28. lay->addWidget(stop);
    29. lay->addWidget(slider);
    30. win->setLayout(lay);
    31. win->show();
    32. return a.exec();
    33. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Supported image format for QMovie?

    you can get supported formats by calling QMovie::supportedFormats.
    btw, I can't load that image even in browser.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Jul 2007
    Location
    Bangalore, India
    Posts
    13
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Supported image format for QMovie?

    here is the list of supported file formats

    http://doc.trolltech.com/4.5/qimager...edImageFormats

Similar Threads

  1. get QImage object from buffer
    By Sheng in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2012, 02:03
  2. QImageIOPlugin, support for new image format.
    By suneel1310 in forum Qt Programming
    Replies: 12
    Last Post: 6th March 2009, 10:21
  3. Image format without bounding rect
    By dreamer in forum Qt Programming
    Replies: 5
    Last Post: 30th April 2008, 22:25
  4. how to load a Qt non-supported Image format
    By Nithya in forum Qt Programming
    Replies: 5
    Last Post: 3rd April 2008, 12:57
  5. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48

Tags for this Thread

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.