You have to change the bounding rect. Otherwise you'll get artifacts in an area that you paint and that is not inside your bounding rect.

Qt Code:
  1. QRectF MyGraphicsPixmapItem::boundingRect() const {
  2. QRectF r = QGraphicsPixmapItem::boundingRect();
  3. return r.translated(-r.width()*0.5, -r.height()*.0.5);
  4. };
To copy to clipboard, switch view to plain text mode