0

I have a QLabel and I can set a gif to animate as qmovie or a png to show as qpixmap. What I want to do is to animate the gif and put a png over it. Both images have transparent background. The gif is animated "loading circle", png is a "check" icon.

The code below is displaying the last one only.

#define MOOD_RESULT ":/mood/mood_result.gif"
#define MOOD_SUCCESS ":/mood/mood_success.png"

ui->moodicon->setPixmap(QPixmap(MOOD_SUCCESS));

QMovie *movie = new QMovie(MOOD_RESULT);
ui->moodicon->setMovie(movie);
movie->start();

I hope a Qt guru can help me.

Thanks in advance

Phillip
  • 259
  • 1
  • 2
  • 11

1 Answers1

0

Here are workable ideas:

  1. Combine the images manually by playing the movie one-by-one into a pixmap, then overpainting the static image, and setting the result on the label.

  2. Derive from QLabel, overload paintEvent, and overpaint the static image after calling QLabel::paintEvent.

  3. Overlay another label on top of the one with the movie.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313