PDA

View Full Version : QLabel based Custom Widget contains QMovie to support GIF Rendering



sheeeng
30th July 2009, 04:16
Hi,

I have a custom widget based on QLabel, which it includes the QMovie.

I did overwrite the paintEvent(QPaintEvent* event).

Added QMovie->setFileName(GifFilePath); and QLabel->setMovie(QMovie); in the paintEvent function.

However, QMovie->isValid() returns false for me. I use isValid() as validation before I start the QMovie.

Why my QMovie is not valid?

Thanks in advance.

nish
30th July 2009, 04:46
first of all you should not set the movie in paintevent.. there is not need for overriding the paintevent..
secondly can we see the code? QLabel->setMovie(QMovie) will not compile for me:)

sheeeng
30th July 2009, 04:58
Hi @MrDeath, thanks for helping me again in another thread here.


void QLabel::setMovie ( QMovie * movie )

So, I should not put it in paintEvent? I would like to show / hide it when user do something.