I currently have a function which I call to scale and rotate a QGraphicsView.

The function is:
Qt Code:
  1. void theForm::scaleView(qreal scaleFactor)
  2. {
  3. qreal scale = pow(2.0, (scaleFactor));
  4. QMatrix matrix;
  5. matrix.scale(scale, scale);
  6. matrix.rotate(levelRotate); // LevelRotate is a global variable
  7. ui.graphicsView->setMatrix(matrix);
  8. }
To copy to clipboard, switch view to plain text mode 

The QGraphicsView has a Pixmap drawn on it from a drawBackground function override.

The function is:
Qt Code:
  1. void Override::drawBackground(QPainter *painter, const QRectF &rect)
  2. {
  3. ...
  4. painter->drawPixmap(0,0, theForm->getBackground()); // getBackground() returns a pixmap
  5. }
To copy to clipboard, switch view to plain text mode 

This above code worked fine at scaling and rotating when getBackground() was returning a reasonable sized (~2mb | 512x600) QPixmap. But I increased the image size (~10mb | 2400x4600) that I was testing with. Now that I've implemented a much larger image, it lags far to much to be useful. So I had a couple questions. Does anyone know of a more efficient way to scale and rotate an image? I tried to call the QGraphicsView's scale and rotate functions directly (i.e graphicsView->rotate(1.2)), without using a QMatrix. That had no effect in speed, and I'm assuming those functions using a QMatrix anyways.

My second related question is that I set the cacheMode on the QGraphicsView to be QGraphicsView::CacheBackground. Since I had overridden the the QGraphicsView with the Override class, does it still cache the background? Does the CacheBackground flag even set the program to cache items that I'm painting through the drawBackground function?

Thanks in advance! I apologize this is so long...