I put this here in case someone other than me runs into the same problem.
Problem
The GIF would not load and isValid()
returns false
.
Code
// Load animated GIF
QMovie* movie = new QMovie("foo.gif");
// Make sure the GIF was loaded correctly
if (!movie->isValid())
{
// Something went wrong :(
}
// Play GIF
QLabel* label = new QLabel(this);
label->setMovie(movie);
movie->start();
Solution
To solve this, I had to put Qt's GIF-plugin qgif4.dll
in
a folder named imageformats
next
to my exe to be able to use GIFs.
The dll can be found under /plugins/imageformats/qgif4.dll