Can you draw on a QPixmap/ QImage?

I tried the following but it doesn't work:

Qt Code:
  1. QPixmap pixmap;
  2. if ( pixmap.load("myImage.png") ) // load and draw image
  3. p->drawPixmap( 100, 85, pixmap );
  4. QPainter pixPaint(pixmap); // Error: Can't convert from QPixmap to const QPaintDevice . But doesn't QPixmap inherit QPaintDevice???
  5. pixPaint.drawLine(1,5);
To copy to clipboard, switch view to plain text mode