title: Rotate + translation?
body: <p>I have a rectangular image (i.e. 1280 x 1024) that I need to rotate around its central point and then translate to a given point.</p>
  
  <p>In a widget paintEvent method, that's what I do:</p>
  
  <pre><code>def paintEvent(self, event):
    # self._center are the coordinates where I want to set the rotated image's center.
  
    t = QtGui.QTransform()
    s = self._pm.size() # self._pm is the image to rotate.
    t.translate(s.width() / 2, s.height() / 2)
    t.rotate(self._degrees)
    t.translate(-s.width() / 2, -s.height() / 2)
  
    # now my image is properly rotated. Now I need to translate it to the final 
    # coordinates.
  
    t.translate (self._center.x, self._center.y)
  
    p = QtGui.QPainter(self)
    p.setTransform(t)
    p.drawPixmap(0, 0, self._pm)
    p.end()
  </code></pre>
  
  <p>And that's fine with rotation. Problem is that I can't find a way to display my image with a new center, it only works if <code>self._degrees</code> is 0.</p>
  
  <p>If I apply another <code>translate</code> to the QTransform object and <code>self._degrees</code> is not 0, the image is never centered where I'd expect it to be.</p>
  
  <p>Could somebody point me to the right direction, please?</p>
  
  <p><strong>Edit</strong><br>
  PS: I forgot to mention that the new center's coordinate are based on the original image's coordinates, not on the rotated image's ones.</p>