QPixmap::fromImage() is a static method returning the pixmap:

Qt Code:
  1. QImage img;
  2. QPixmap pix = QPixmap::fromImage(img);
To copy to clipboard, switch view to plain text mode