title: Rotate rectangle around its center
body: <p>I need to rotate a rectangle around it's center-point and display it in the center of a QWidget. Can you complete this specific code? If possible, could you also dumb-down the explaination or provide a link to the simplest explaination?</p>
  
  <p>Please note: I have read the Qt documentation, compiled examples/demos that deal with rotation and I STILL cannot understand it!</p>
  
  <pre><code>void Canvas::paintEvent(QPaintEvent *event)
  {
      QPainter paint(this);
  
      paint.setBrush(Qt::transparent);
      paint.setPen(Qt::black);
      paint.drawLine(this-&gt;width()/2, 0, this-&gt;width()/2, this-&gt;height());
      paint.drawLine(0, this-&gt;height()/2, this-&gt;width(), this-&gt;height()/2);
  
      paint.setBrush(Qt::white);
      paint.setPen(Qt::blue);
  
      // Draw a 13x17 rectangle rotated to 45 degrees around its center-point
      // in the center of the canvas.
  
      paint.drawRect(QRect(0,0, 13, 17));
  
  }
  </code></pre>