PDA

View Full Version : How to add a gif to a Qt Project?



Bong.Da.City
6th September 2010, 19:46
If i add an animated gif image to a label ( pixmap ) and then compile the application the movement of the animated gif image will not been show... How can it been shown?

Take for example the attachment gif image....

Lykurg
6th September 2010, 20:03
The search function of this forum could be helpful. QMovie.

Bong.Da.City
6th September 2010, 20:21
I had add this to the constructor and the label just do not show nothing... ( the part that is saying icons/bsusy.gif i had changed it to :/icons/bsusy.gif but still nothing )


QLabel FlamesLabel;
QMovie *movie = new QMovie("icons/bsusy.gif");

FlamesLabel.setMovie(movie);
movie->start();

Any ideas?

wysota
6th September 2010, 21:27
Is this your actual code? The label seems to be a local variable.

Bong.Da.City
6th September 2010, 21:36
Is this your actual code? The label seems to be a local variable.

Yes this the actual code... Flames Lbel is the label i want to be on the backround

squidge
6th September 2010, 21:51
and why is it a local variable rather than on the heap?

Show more of your code. What you are posting is unlikely to work as you expect.