tags:

views:

729

answers:

1

I'm displaying an animated gif in my application by creating a QLabel, and setting the movie as a QMovie. The problem I'm having is that when the gif is displayed, any part of the image that stays a constant color throughout the animation shows up as the background color. I hope I'm explaining that clearly. Here's the code I'm using to create the animation if that helps:

rewardLabel=new QLabel();
rewardLabel->setCursor(QCursor(Qt::BlankCursor));
rewardLabel->setWindowFlags(Qt::FramelessWindowHint);
rewardLabel->hide();
string movieTemp="animations/"+animationFiles[animationIndex];
QString movieFile(movieTemp.c_str());
rewardMovie=new QMovie(movieFile);
rewardLabel->setMovie(rewardMovie);

Let me know if I need to explain the situation better. Thanks in advance.

A: 

Take a look at the QWidgets window attributes. I believe the ones you're interested in are:

Qt::WA_OpaquePaintEvent
Qt::WA_NoSystemBackground
Qt::WA_TranslucentBackground

There might be a couple of widget flags of interest too, but I think they've all been moved to flags in Qt-4.

Kaleb Pederson