1

I can rotate QPixmap with code like this

  QPixmap pix("img.jpg");
  QMatrix rm;
  rm.rotate(90);
  pix = pix.transformed(rm)

how can I do same with QMovie? Or somehow wrap it into some "container" and rotate that "container"?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
l4zygreed
  • 13
  • 2

1 Answers1

0

You can try to rotate frame by frame. For example:

m_movie = new QMovie(":/gif/tenor.gif");
connect(m_movie, SIGNAL(frameChanged(int)), this, SLOT(OnFrameChanged(int)));
ui->lblMovie->setMovie(m_movie);
m_movie->start();

And rotate every frame when frame changed

void MainWindow::OnFrameChanged(int /*frame*/)
{
    QPixmap pixmap = m_movie->currentPixmap();
    QMatrix rm;
    rm.rotate(90);
    pixmap = pixmap.transformed(rm);
    ui->lblMovRotated->setPixmap(pixmap);
}
Serhiy Kulish
  • 1,057
  • 1
  • 6
  • 8