If the drawing is cut then your call to setViewport() is apparently invalid.

However if you want to do rotations then I doubt setWindow is a good solution. It's easier to just translate the painter.

Qt Code:
  1. void X::paintEvent(QPaintEvent *) {
  2. QPainter p(this);
  3. p.translate(width()/2, height()/2);
  4. p.drawEllipse(-50, -50, 100, 100);
  5. }
To copy to clipboard, switch view to plain text mode