Okay, I've been sitting on this issue for at least 4 hours now and just am exhausted.
I'm trying to simply rotate a QGraphicsPixmapItem by 45° around its own axis.

Qt Code:
  1. MyPixmap::MyPixmap() : QGraphicsPixmapItem()
  2. {
  3. this->setPixmap(QPixmap("wallpaper.jpg"));
  4.  
  5. QTransform t = this->transform();
  6.  
  7. t.translate(this->pixmap().width()/2, this->pixmap().height()/2);
  8. t.rotate(45, Qt::XAxis);
  9. t.translate(-this->pixmap().width()/2, -this->pixmap().height()/2);
  10.  
  11. this->setTransform(t);
  12. }
To copy to clipboard, switch view to plain text mode 
I tried alot of other options but the image is always moving around the whole screen and this is what comes out:



Shouldn't the lower edge be large and the upper edge small, like a trapezoid? Anyway, that's what I want it to be but it seems like I'm missing something here